Пример #1
0
 internal static Users FromDTO(this UsersDTO usersDTO)
 {
     return(new Users()
     {
         Id = usersDTO.Id,
         Name = usersDTO.Name,
         EmailAddress = usersDTO.EmailAddress,
         PasswordHash = CryptographyHelpers.Encrypt(Data.password, Data.salt, usersDTO.Password)
     });
 }
Пример #2
0
 internal static UsersDTO ToDTO(this Users users)
 {
     return(new UsersDTO()
     {
         Id = users.Id,
         Name = users.Name,
         EmailAddress = users.EmailAddress,
         Password = CryptographyHelpers.Decrypt(Data.password, Data.salt, users.PasswordHash)
     });
 }