Let's say I have a RegisterModel for registering a user, and some UserService that implement IUserService
public interface IUserService
{
User CreateUser(User newUser);
}
[HttpPost]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
User user = _userService.CreateUser(newuser);
_authenticationService.SetAuthenticatedUser(user);
return RedirectToRoute("Homepage");
}
return View(model);
}
Given that RegisterModel can be very complex, where the logic needs to go to map RegisterModel to a User object
Eldar source
share