public IActionResult DeleteWeight([FromBody] EditWeightViewModel model) { if (ModelState.IsValid) { var weight = Mapper.Map <EditWeightViewModel, Weight>(model); _weightService.DeleteWeight(weight); } return(new HttpStatusCodeResult(200)); }
public IActionResult EditWeight([FromBody] EditWeightViewModel model) { if (ModelState.IsValid) { var weight = Mapper.Map <EditWeightViewModel, Weight>(model); weight.LastModifiedDateUtc = System.DateTime.UtcNow; weight.LastModifiedBy = 1; _weightService.EditWeight(weight); } return(new HttpStatusCodeResult(200)); }