public void AddCamper(Camper camper) { using (var context = new MedFormsContext(_connectionString)) { context.Campers.Add(camper); context.SaveChanges(); } }
public void AddUser(User user, string password) { user.PasswordHash = BCrypt.Net.BCrypt.HashPassword(password); using (var context = new MedFormsContext(_connectionString)) { context.Users.Add(user); context.SaveChanges(); } }