Rodrigo_Moraes

Untitled

Jul 7th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1.  public class Usuario
  2.     {
  3.         public Usuario()
  4.         {
  5.             Equipes = new List<Equipe>();
  6.         }
  7.  
  8.         public int Id { get; set; }
  9.         public string Login { get; set; }
  10.  
  11.         private string senha;
  12.  
  13.         public string GetSenha()
  14.         {
  15.             return senha;
  16.         }
  17.  
  18.         public void SetSenha(string value)
  19.         {
  20.             byte[] salt = Encoding.UTF8.GetBytes(Login);
  21.             senha = new System.Security.Cryptography.SHA256Managed().ComputeHash(Encoding.UTF8.GetBytes(value).Concat(salt).ToArray()).ToString();
  22.         }
  23.  
  24.         public virtual ICollection<Equipe> Equipes { get; set; }
  25.  
  26.     }
Add Comment
Please, Sign In to add comment