User939559474 posted
i wanna to get count of rows but when not duplicate date and compare the count of rows with "AbsentCount" column in "GroupAttend" class "Group" class and "GroupAttend" class related with relationship
public class Group
{
[Key]
public int GroupID { get; set; }
public string Code { get; set; }
public string Title { get; set; }
public string Summury { get; set; }
public string Details { get; set; }
public string Place { get; set; }
public int? AbsentCount { get; set; }
public string img { get; set; }
public DateTime? DateAdded { get; set; }
public Guid UserAddID { get; set; }
public Guid userEditID { get; set; }
public int InstructorID { get; set; }
public int CategoryID { get; set; }
public int SubCategoryID { get; set; }
public int CourseID { get; set; }
public int LevelID { get; set; }
public DateTime DateUpdated { get; set; }
public bool DelFlag { get; set; }
public DateTime? DelDate { get; set; }
public Guid? UserDelID { get; set; }
public virtual IList<GroupAttend> GroupAttends { get; set; }
}
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; }
}
please wanna do this using lambda expression.
i try this
var query = context.Groups.Select(d.GroupAttends.Count() ==d.AbsentCount);
where using distinct with (GroupAttends.DateAdded) here