public IHttpActionResult UpdateLot([FromBody] LotModel lot) { if (!ModelState.IsValid) { return(BadRequest("Invalid input")); } var newLot = Mapper.Map <LotModel, LotDTO>(lot); try { lotService.EditLot(newLot); return(Ok("Lot updated successfuly")); } catch (NotFoundException) { return(NotFound()); } catch (ArgumentNullException) { return(BadRequest("You should give lot")); } }