public async Task <IActionResult> Post([FromBody] Models.Shop body) { _logger.LogInfo("Creating shop"); var createdShop = await shopService.CreateShop(body.Name, body.Description, body.TypeOfShop, body.City); _logger.LogInfo("Shop created"); return(Ok(createdShop)); }
public ActionResult Create(ShopCreate model) { if (!ModelState.IsValid) { return(View(model)); } var service = new ShopService(); if (service.CreateShop(model)) { TempData["SaveResult"] = "Shop added."; return(RedirectToAction("Create", "Artist")); } ModelState.AddModelError("", "Shop could not be added."); return(View(model)); }