public ActionResult Insert(EmployeeModel model) { if (Request.Files.Count > 0) { if (Request.Files[0].ContentLength == 0 && string.IsNullOrEmpty(model.Employee_image)) { ModelState.AddModelError(nameof(EmployeeModel.Employee_image), "Image is required"); } } if (ModelState.IsValid) { model.Employee_image = SaveImage(); _logic.Create(model); return(RedirectToAction("manager")); } AddInsertViewBag(); return(View()); }
public IActionResult Create([FromBody] Employee employee) { return(Ok(_employeeLogic.Create(this.OrganizationId, employee))); }