Esempio n. 1
0
 public object DeleteGroup(Group group, long userId)
 {
     logger.Log(LogLevel.Debug, $"ShareController.DeleteGroup({Json(group)}, {userId})");
     try
     {
         if (ShareManager.UnshareGroup(group, userId))
         {
             return(Ok());
         }
         else
         {
             return(NotFound());
         }
     }
     catch (Exception ex)
     {
         logger.Log(LogLevel.Error, $"ShareController.DeleteGroup({Json(group)}, {userId}) - {ex}");
         //изменить http status code
         return(new Response(100, ex.Message));
     }
 }
 public object DeleteGroup(long groupId, long userId)
 {
     logger.Log(LogLevel.Debug, $"ShareController.DeleteGroup({groupId}, {userId})");
     try
     {
         if (ShareManager.UnshareGroup(groupId, userId))
         {
             return(new HttpStatusCodeResult(200));
         }
         else
         {
             return(new HttpStatusCodeResult(404));
         }
     }
     catch (Exception ex)
     {
         logger.Log(LogLevel.Error, $"ShareController.DeleteGroup({groupId}, {userId}) - {ex}");
         //изменить http status code
         return(Json(new Response(100, ex.Message), JsonRequestBehavior.AllowGet));
     }
 }