public static void AddUser(User user) { using (var context = new CountingRequestContext()) { context.Users.Add(user); context.SaveChanges(); } }
public static void DeleteCountingRequest(CountingRequest countingRequest) { using (var context = new CountingRequestContext()) { countingRequest.DeleteDatabaseValues(); context.CountingRequests.Remove(countingRequest); context.SaveChanges(); } }