public void AddTask(TaskItem task) { using (var context = new TaskItemsContext(_connectionString)) { context.TaskItems.Add(task); context.SaveChanges(); } }
public void AddUser(User user, string password) { user.PasswordHash = BCrypt.Net.BCrypt.HashPassword(password); using (var context = new TaskItemsContext(_connectionString)) { context.Users.Add(user); context.SaveChanges(); } }