public void UpdateUser(string userId, string password) { using (var context = new MyappEntities()) { var user = context.TBL_USERS.Single(x => x.user_id == userId); user.password = password; context.SaveChanges(); } }
public void DeleteUser(string userId) { using (var context = new MyappEntities()) { var user = context.TBL_USERS.Single(x => x.user_id == userId); context.TBL_USERS.Remove(user); context.SaveChanges(); } }
public void AddUser(string userId, string password) { using (var context = new MyappEntities()) { context.TBL_USERS.Add(new TBL_USERS() { user_id = userId, password = password }); context.SaveChanges(); } }