using System; using Microsoft.AspNetCore.Identity; namespace Dough.Models.Database { public class User : BaseModel { public User(string username = default) { Username = username; } public string Password { get; set; } public string Username { get; set; } public void Update(User data) { Username = data.Username; base.Update(data); } public void HashAndSetPassword(string password) { Password = BCrypt.Net.BCrypt.HashPassword(password); } public bool VerifyPassword(string password) { return BCrypt.Net.BCrypt.Verify(password, Password); } } }