public ActionResult ShoeCreate(ShoeModel shoe) { ViewBag.UserId = User.Identity.GetUserId(); if (ModelState.IsValid) { _service.CreateShoe(shoe); return(RedirectToAction("ShoeIndex")); } return(View()); }
public ActionResult <Shoe> Post([FromBody] Shoe shoe) { try { return(Ok(_shoeService.CreateShoe(shoe))); } catch (Exception e) { return(BadRequest(e.Message)); } }