コード例 #1
0
 public IActionResult DeleteWeight([FromBody] EditWeightViewModel model)
 {
     if (ModelState.IsValid)
     {
         var weight = Mapper.Map <EditWeightViewModel, Weight>(model);
         _weightService.DeleteWeight(weight);
     }
     return(new HttpStatusCodeResult(200));
 }
コード例 #2
0
 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));
 }