예제 #1
0
 // 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();
     }
 }
예제 #2
0
 // Adds specified request
 internal static void AddRequest(Request request)
 {
     using (var context = new NumberConverterDBContext())
     {
         context.Requests.Add(request);
         context.SaveChanges();
     }
 }
예제 #3
0
 // Adds new user into the database
 internal static void AddUser(User user)
 {
     using (var context = new NumberConverterDBContext())
     {
         context.Users.Add(user);
         context.SaveChanges();
     }
 }