In query in Entity Frame work
- by Syed Salman Raza Zaidi
I am working on Entity frame work, i have created a method which is returning List of my Table,
I am retrieving data on base of grpID(which is foreign key, so i can have multiple records)
I have saved these grpID's in an array so I want to run IN command on Entity framework so that i can get records in single List, How can i apply In command,my code is below
public List<tblResource> GetResources(long[] grpid)
{
try
{
return dataContext.tblResource.Where(c => c.GroupId == grpid && c.IsActive == true).ToList();//This code is not working as i am having array of groupIds
}
catch (Exception ex)
{
return ex;
}
}