public async Task <ApiResult <UserInfoViewModel> > RegisterProfesor (RegisterProfesorViewModel model) { return(await RegisterUser(model, "Profesor", (usuarioId) => { _dataAccess.AddProfesor(model.Map(usuarioId)); })); }
public async Task <IActionResult> RegisterProfesor (RegisterProfesorViewModel model, string returnUrl = null) { if (ModelState.IsValid) { var result = await RegisterUser(model, "Profesor", (usuarioId) => { _dataAccess.AddProfesor(model.Map(usuarioId)); }); if (result) { return(RedirectToLocal(returnUrl)); } } // If we got this far, something failed, redisplay form return(View(model)); }