Hi all.
I have a one-to-many relationship for my entity set, however on some occasions I only want to return one of the child entities, however when using the include function I cannot change my where clause to single out the child entities;
Sample query, so in this case the data_PERSON can have multiple data_ROLE entities, however I may just want to bring back one data_ROLE record [as an example their active role]
public IQueryable<data_PERSON> GetDataForTeam(System.Guid personguid)
{
return this.ObjectContext.data_PERSON
.Include("data_ROLE");
}
So when I do the where clause I cannot query the data_ROLE so in essence want some like this;
public IQueryable<data_PERSON> GetDataForTeam(System.Guid personguid)
{
return this.ObjectContext.data_PERSON
.Include("data_ROLE");
.Where(o=>o.data_ROLE.isactive==true);
}
Thanks
P