Beispiel #1
0
 public IActionResult AddToGroup([FromBody] GroupAdd groupAdd)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try
     {
         _groupsService.AddToGroup(groupAdd);
         return(Ok());
     }
     catch (NullReferenceException ex)
     {
         return(NotFound(ex.Message));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }