我在项目里面使用ef想对数据库操作在design.cs里面得到类
public partial class EventSetupRecordDataContext : System.Data.Linq.DataContext
有一个属性如下
public System.Data.Linq.Table<EventSetupRecord> EventSetupRecords
{
get
{
return this.GetTable<EventSetupRecord>();
}
}
我自己新建了一个项目里面 使用ef,design.cs的context类如下
public partial class dlinqEntities1 : ObjectContext
{
#region Constructors
/// <summary>
/// Initializes a new dlinqEntities1 object using the connection string found in the 'dlinqEntities1' section of the application configuration file.
/// </summary>
public dlinqEntities1() : base("name=dlinqEntities1", "dlinqEntities1")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
然后会有一个返回一张表的属性entitytable
public ObjectSet<entitytable> entitytable
{
get
{
if ((_entitytable == null))
{
_entitytable = base.CreateObjectSet<entitytable>("entitytable");
}
return _entitytable;
}
}
private ObjectSet<entitytable> _entitytable;
是什么造成这种不同的?还有属性返回的类型,还有类的父类有什么差异?
是.net3.5更多 的靠近 linq to sql 后面是.net4.0 做了改进