コード例 #1
0
ファイル: ShoppingCartActions.cs プロジェクト: dulle204/MyRep
 public void Dispose()
 {
     if (_db != null)
     {
         _db.Dispose();
         _db = null;
     }
 }
コード例 #2
0
ファイル: ProductList.aspx.cs プロジェクト: dulle204/MyRep
 public IQueryable<Products> GetProducts([QueryString("id")] int? categoryId)
 {
     var _db = new ProductContext();
     IQueryable<Products> query=_db.Products;
     if (categoryId.HasValue && categoryId > 0)
     {
         query = query.Where(p => p.CategoryID == categoryId);
     }
     return query;
 }
コード例 #3
0
ファイル: Site.Master.cs プロジェクト: dulle204/MyRep
 public IQueryable<Category> GetCategories()
 {
     var _db = new ProductContext();
     IQueryable<Category> query = _db.Categories;
     return query;
 }