2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using ModelLayer.PocoModels;
using System.Data.Objects;
namespace ModelLayer
{
public class NorthwindDataContext : ObjectContext
{
private ObjectSet<Category> _categories;
private ObjectSet<Product> _products;
public NorthwindDataContext()
: base("name=NorthwindEntities",
"NorthwindEntities")
{
_categories = CreateObjectSet<Category>();
_products = CreateObjectSet<Product>();
}
}
}
在上面的代码中,我得到一个错误,因为它不能找到ObjectSet
类,并给了我类型或命名空间找不到error.While示例项目中正常工作是使用System.Data.Objects.ObjectSet
下,但我没有看到图书馆我目前的项目?我使用的是asp.net mvc和.net 4.0。有没有人有任何好主意?找不到ObjectSet库?
明白了..这是由于某种原因使用.net 3.5 ..我的坏:( – Vishal 2011-01-24 21:04:43