public ActionResult Create(CreateNurseViewModel nursevm) { if (!ModelState.IsValid) { return(View(nursevm)); } var nurse = _mapper.Map <CreateNurseViewModel, User>(nursevm); if (!_nurseService.CheckUniqueness(nurse)) { ModelState.AddModelError("", "User with same UserName or Email exist!"); return(View(nursevm)); } _nurseService.Create(nurse); _loggerService.Info($"{User.Identity.Name} added {nurse.FirstName} {nurse.LastName}"); return(RedirectToAction("Index")); }
public ActionResult Create() { var nurse = new CreateNurseViewModel(); return(View(nurse)); }