Skip to content

Instantly share code, notes, and snippets.

@arc95
Created September 20, 2018 14:21
Show Gist options
  • Save arc95/7fe76d5670b68c1b7c9c5971e2403ae4 to your computer and use it in GitHub Desktop.
Save arc95/7fe76d5670b68c1b7c9c5971e2403ae4 to your computer and use it in GitHub Desktop.
public static async Task<List<AgentViewModel>> GetAgentsListAsync()
{
using (var db = new Context())
{
var q = db.Agents
.AsEnumerable()
.Select(x => x.ToAgentViewModel())
.OrderBy(x => x.Name);
return await Task.Run(() => new List<AgentViewModel>(q));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment