public async void DeleteRole(int roleID)
 {
     try
     {
         using (var ctx = new DevoxContext())
         {
             var role = ctx.Role.FirstOrDefault(x => x.RoleId == roleID);
             ctx.Remove(role);
             await ctx.SaveChangesAsync();
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 2
0
 public async Task DeleteProject(int projectID)
 {
     try
     {
         using (var ctx = new DevoxContext())
         {
             var p = ctx.Project.FirstOrDefault(x => x.ProjectId == projectID);
             ctx.Remove(p);
             await ctx.SaveChangesAsync();
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }