public async Task <IActionResult> AddUser([FromBody] Good good) { if (good != null) { TinyMapper.Bind <Good, web_store.BL.Model.Good>(); var newGood = TinyMapper.Map <web_store.BL.Model.Good>(good); await goodService.AddGood(newGood); return(Ok(good)); } else { return(BadRequest()); } }
public ActionResult Add(GoodViewModel good) { service.AddGood(good); return(RedirectToAction("Index")); }