// Updates specified user in the database internal static void SaveUser(User user) { using (var context = new NumberConverterDBContext()) { context.Entry(user).State = EntityState.Modified; context.SaveChanges(); } }
// Adds specified request internal static void AddRequest(Request request) { using (var context = new NumberConverterDBContext()) { context.Requests.Add(request); context.SaveChanges(); } }
// Adds new user into the database internal static void AddUser(User user) { using (var context = new NumberConverterDBContext()) { context.Users.Add(user); context.SaveChanges(); } }