Ejemplo n.º 1
0
 public HttpResponseMessage AddRace(RaceModelDto request)
 {
     try
     {
         _dataAccess.AddRace(request);
         return(Request.CreateResponse(HttpStatusCode.OK));
     }
     catch (Exception exception)
     {
         SmartApartmentLogger.LogAsync(ELogType.Error, exception.Message);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError,
                                       new ErrorResponse(500, "Internal server error. Please try again later")));
     }
 }
 public void AddRace(RaceModelDto dto)
 {
     _entities.races.Add(dto.ToDbObject());
     _entities.SaveChanges();
 }