// POST: api/Customer public HttpResponseMessage Post([FromBody] CustomerModel customer) { int customerId = _customerServices.Create(customer); return(customerId > 0 ? Request.CreateResponse(HttpStatusCode.OK, customerId) : Request.CreateResponse(HttpStatusCode.Conflict, "Customer with this name exists.")); }
public IActionResult _PVCreate(Customer customer) { try { if (ModelState.IsValid) { services.Create(customer); return(RedirectToAction("Index")); } } catch (Exception ex) { ViewBag.Msg = ex.Message; } return(View()); }
public ActionResult <Guid> CreateCustomer(CustomerCreateRequestModel customerRequestModel) { var customerModel = _customerServices.Create(new CustomerModel(customerRequestModel)); return(customerModel.Id); }
public CustomerModel CreateItem([FromBody] CustomerModel model) { _customerServices.Create(model); return(model); }