public IActionResult FirstTimeLogIn() { int roleId = Convert.ToInt32(User.Claims.Where(claim => claim.Type == "RoleId").Select(claim => claim.Value).SingleOrDefault()); FirstTimeLogInViewModel viewModel = new FirstTimeLogInViewModel(roleId); return(View("FirstTimeLogIn", viewModel)); }
public IActionResult FirstTimeLogIn(FirstTimeLogInViewModel viewModel) { int userId = Convert.ToInt32(User.Claims.Where(claim => claim.Type == "Id").Select(claim => claim.Value).SingleOrDefault()); Account dataForUser = new Account { Id = userId, Phone = viewModel.Phone, Location = viewModel.Location, Gender = viewModel.Gender, RoleId = viewModel.RoleId }; _registerLogic.FirstTimeLogIn(dataForUser); return(RedirectToAction("Index", "Home")); }