我想得到行数,但是日期不重复 例如
id name date
1 ali 1/1/2014
2 hoda 1/1/2014
3 samir 2/1/2014
正确的计数是2,因为我想计算一次日期 我正在使用实体框架和lambda表达式 我正在使用下面的课程
public class GroupAttend
{
[Key]
public int AttendID { get; set; }
public int GroupID { get; set; }
public int StudentID { get; set; }
public int InstructorID { get; set; }
public int TimeID { get; set; }
public DateTime DateAdded { get; set; }
public int LevelID { get; set; }
public bool? AttendStatue { get; set; }
public DateTime DateUpdated { get; set; }
public bool DelFlag { get; set; }
public DateTime? DelDate { get; set; }
public Guid UserAddID { get; set; }
public Guid userEditID { get; set; }
public Guid? UserDelID { get; set; }
}
感谢
答案 0 :(得分:0)
int count = context.Table.Select(x => x.DateTimeProperty).Distinct().Count();