public long GetFindProfilesCount(Profile profile, FindProfilesParams param) { return FindProfilesQuery(profile, param).Count(); }
private IQueryable<Profile> FindProfilesQuery(Profile profile, FindProfilesParams param) { return this.Profiles .Where(m => m.New == false) .Where(m => m.ProfileId != profile.ProfileId) .Include(m=>m.Intereses) .OrderByDescending(m => m.LastName) .AsQueryable(); }
public List<Profile> FindProfiles(Profile profile, FindProfilesParams param) { List<Profile> result; var query = FindProfilesQuery(profile, param); if (param.Take != 0) { query = query.Skip(param.Skip).Take(param.Take); } result = query.ToList(); return result; }