public static async Task <List <Person_WithMoreInfo> > GetLocalDataAsync(int companyId, int arg1) { using (var db = new SimplifiedModelEntities()) { return(await FetchAndFilterAsync(GetPersonQueryableForList(db, companyId))); } }
private static IQueryable <Person_WithMoreInfo> GetPersonQueryableForList(SimplifiedModelEntities db, int companyId) { var query = from a in db.Person_WithMoreInfo join b in db.Person_GetForCompany(companyId) on a.Person_Id equals b.Person_Id select a; query = query.Where(fs => db.Companies.Any(x => x.Company_Id == fs.Company_Id)); return(query); }