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(); } }
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(); } }