コード例 #1
0
 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();
     }
 }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 public List <TBL_USERS> GetUsers()
 {
     using (var context = new MyappEntities())
     {
         // var ret = context.TBL_USERS.ToList();
         var ret = context.TBL_USERS.ToList();
         return(ret);
     }
 }
コード例 #4
0
 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();
     }
 }