public void AddUser(User user, string password) { string hash = BCrypt.Net.BCrypt.HashPassword(password); using var ctx = new SimpleAdsContext(_connectionString); user.PasswordHash = hash; ctx.Users.Add(user); ctx.SaveChanges(); }
public void AddSimpleAd(SimpleAd ad) { using var ctx = new SimpleAdsContext(_connectionString); ctx.Ads.Add(ad); ctx.SaveChanges(); }