Ejemplo n.º 1
0
        public async Task <IdentityResult> RegisterUser(UserProfileViewModel userProfileVM)
        {
            IdentityUser user = new IdentityUser
            {
                UserName = userProfileVM.UserName,
                Email    = userProfileVM.Email
            };

            var result = await userManager.CreateAsync(user, userProfileVM.Password);

            if (result.Succeeded)
            {
                userProfile = new UserProfile
                {
                    UserID   = user.Id,
                    UserName = userProfileVM.UserName,
                    Email    = userProfileVM.Email,
                    FullName = userProfileVM.FullName,
                    MobileNo = userProfileVM.MobileNo
                };
                ompContext.UserProfile.Add(userProfile);
                ompContext.SaveChanges();
            }
            return(result);
        }
Ejemplo n.º 2
0
 public void Save()
 {
     db.SaveChanges();
 }