Example #1
0
 public HttpResponseMessage SaveAll(IEnumerable <LevelGroupModel> levelGroupModels)
 {
     try
     {
         _service.UpdateMultiLevelGroups(levelGroupModels.AsQueryable().Project().To <LevelGroup>().AsEnumerable());
         return(Request.CreateResponse());
     }
     catch (StaffingPurchaseException ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, new HttpError(ex.Message)));
     }
     catch (Exception ex)
     {
         _logger.Error("Error when saving multiple Level Groups", ex);
         return(Request.CreateErrorResponse(
                    HttpStatusCode.InternalServerError,
                    new HttpError(_resourceManager.GetString(ExceptionResources.GeneralException))));
     }
 }