Allerede nu kan du forenkle din forespørgsel sådan her;) :
int start=page * recordsInPage;
var inner = (from user in db.Users
where user.Name.Contains(name) && !user.Deleted && user.AppearInSearch
orderby user.Verified descending
select new
{
Name = user.Name,
Verified = user.Verified,
PhotoURL = user.PhotoURL,
UserID = user.Id,
Subdomain = user.Subdomain,
Deleted=user.Deleted,
AppearInSearch = user.AppearInSearch
}
).Skip(start).Take(recordsInPage);
return await inner.ToListAsync();
Hvis du har et ydeevneproblem, så prøv at oprette en lagret procedure med din SQL og brug den med entity Framework.