public bool Authorize(int id, string token) { using (var context = new BackendContext()) { return(context.Users.Any(user => user.Id == id && user.Token == token)); } }
public static object GetProgerssList(int projectId) { using (var context = new BackendContext()) { return((from progress in context.Progresses where progress.ProjectId == projectId select new { id = progress.Id, name = progress.Name, order = progress.Order }).OrderBy(p => p.order).ToArray()); } }