예제 #1
0
        public AuthResult Create(User user)
        {
            user.ThrowIfNull("user");

            var appIdentityUser   = IdentityModelFactory.Create(user);
            var identityResult    = _userManager.Create(appIdentityUser);
            var appIdentityResult = IdentityModelFactory.Create(identityResult);

            // if create is successful, copy the AppIdentityUser's properties
            // back to the AppUser that was passed in
            if (appIdentityResult.Succeeded)
            {
                user.CopyFrom(appIdentityUser);
            }

            return(appIdentityResult);
        }