コード例 #1
0
ファイル: IdentityModels.cs プロジェクト: martinezrey/apps
        /*IUserStore*/

        public async Task CreateAsync(SystemUser user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (user.DomainLogin == null)
            {
                throw new InvalidOperationException("Cannot create user as the 'UserName' property is null on user parameter.");
            }

            //user.Id = userRepository.GetKey(user.Email);

            await _userRepo.CreateAsync(user);

            //user.Id = userRepository.GetKey(user.Email);

            //user.Id = userRepository.GetKey(user.Email);
            //await emailRepository.SaveAsync(new CouchbaseUserEmail
            //    {
            //        Email = user.Email,
            //        UserId = user.UserName,
            //        ConfirmationRecord = new ConfirmationRecord
            //        {
            //             ConfirmedOn = DateTime.UtcNow,
            //        },
            //        Id = user.Email
            //    });
            //await phoneNumberRepository.SaveAsync(new CouchbaseUserPhoneNumber
            //    {
            //        UserId = user.Id,
            //        PhoneNumber = user.PhoneNumber
            //    });
            //await _couchbaseClient.SaveChangesAsync().ConfigureAwait(false);
        }