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
Member
43 Points
80 Posts
using distinct with child and parent 2 classes using lambda expression
Feb 05, 2014 11:52 AM|haitham shaaban|LINK
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
please wanna do this using lambda expression.
i try this
where using distinct with (GroupAttends.DateAdded) here
All-Star
15648 Points
2151 Posts
Re: using distinct with child and parent 2 classes using lambda expression
Feb 06, 2014 12:55 AM|Happy Chen - MSFT|LINK
hi haitham,
According to your description, i would suggest you try the way below:
Hope it helps you.