Say I have RegisterModel for user registration and some UserService that implementing IUserService
public interface IUserService
{
User CreateUser(User newUser);
}
[HttpPost]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
// ... logic for newuser
User user = _userService.CreateUser(newuser);
_authenticationService.SetAuthenticatedUser(user);
return RedirectToRoute("Homepage");
}
return View(model);
}
Given that RegisterModel might be very complex, where is the logic should go for mapping RegisterModel to User object