Exemplo n.º 1
0
 public bool Authorize(int id, string token)
 {
     using (var context = new BackendContext())
     {
         return(context.Users.Any(user => user.Id == id && user.Token == token));
     }
 }
Exemplo n.º 2
0
 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());
     }
 }