Inheritance: DbContext
示例#1
0
文件: UserDAL.cs 项目: hwqdt/Demos
 public IList<UserInfo> GetAllUsers()
 {
     using (DB db = new DB())
     {
         return db.UserInfoes.ToList();
     }
 }
示例#2
0
文件: UserDAL.cs 项目: hwqdt/Demos
 public UserInfo GetUser(int id)
 {
     using (DB db = new DB())
     {
         return db.UserInfoes.Find(id);
     }
 }
示例#3
0
文件: UserDAL.cs 项目: hwqdt/Demos
 public bool AddUser(UserInfo user)
 {
     using (DB db = new DB())
     {
         db.UserInfoes.Add(user);
         return db.SaveChanges() > 0;
     }
 }