예제 #1
0
 public static void ChangePassword(string login, string password)
 {
     using (var context = new MVCDBEntities())
     {
         var user = context.Users.First(u => u.Login == login);
         user.Password = password;
         context.SaveChanges();
     }
 }
예제 #2
0
 public static void Add(string login, string password)
 {
     using (var context = new MVCDBEntities())
     {
         var user = new User {Login = login, Password = password};
         context.Users.Add(user);
         context.SaveChanges();
     }
 }