Beispiel #1
0
        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());
            }
        }
Beispiel #2
0
        public ActionResult Add(GoodViewModel good)
        {
            service.AddGood(good);

            return(RedirectToAction("Index"));
        }