public bool DeleteChallenge(string id)
 {
     try
     {
         _ctx.Challenges.Remove(_ctx.Find <Entities.Challenge.Challenge>(id));
         return(_ctx.SaveChanges() > 0);
     }
     catch (Exception e)
     {
         _logger.LogError($"Failed to delete challenge : {e}");
         return(false);
     }
 }
Example #2
0
 public bool DeleteUser(string id)
 {
     try
     {
         _ctx.User.Remove(_ctx.Find <Entities.User.User>(id));
         return(_ctx.SaveChanges() > 0);
     }
     catch (Exception e)
     {
         _logger.LogError($"Failed to delete user : {e}");
         return(false);
     }
 }