Exemple #1
0
        public async Task <bool> CreateUserAsync(ApplicationUser user)
        {
            if (user == null)
            {
                return(false);
            }

            // we create snapshot of this object due to parameter passing by ref
            var snapshot = (ApplicationUser)user.Clone();

            snapshot.Email    = _personalDataProtector.Protect(user.Email);
            snapshot.UserName = _personalDataProtector.Protect(user.UserName);

            return(await _instance.CreateUserAsync(snapshot));
        }
 public PersonalDataConverter(IPersonalDataProtector protector)
     : base(
         s => protector.Protect(s),
         s => protector.Unprotect(s))
 {
 }