public ActionResult Create([Bind] Customer objModel) { if (ModelState.IsValid) { objModel.UserId = Convert.ToInt32(TempData["SessionUserId"]); _customerService.AddUpdateCustomer(objModel); TempData["Success"] = "Information added successfully!"; return(RedirectToAction("Index")); } return(View(objModel)); }
public IActionResult AddCustomer([FromBody] Customer model) { if (ModelState.IsValid) { var Customers = _customerService.AddUpdateCustomer(model); return(Ok(Customers)); } return(BadRequest()); }