數據訪問方式之EntityFramework(2)

添加控制器 在控制器中實例化數據上下文: private readonly DBContext _db = new DBContext(); 列表 後臺: return View(_db.Product.ToList()); var list = _db.Product.OrderByDescending(s => s.Id).Skip(rows * (page - 1)).Take(rows).
相關文章
相關標籤/搜索