我想把它写成用户定义的函数:
private double Score(Story s){
DateTime now = DateTime.Now;
TimeSpan elapsed = now.Subtract(s.PostedOn);
double daysAgo = elapsed.TotalDays;
return s.Votes.Count + s.Comments.Count - daysAgo;
}
这可能与UDF有关吗?