首页 新闻 赞助 找找看

ADO.NET实体框架中这一条语句怎么理解?

0
悬赏园豆:10 [已关闭问题]

public partial class UserManagerEntities : global::System.Data.Objects.ObjectContext
    {
        public UserManagerEntities() :
                base("name=UserManagerEntities", "UserManagerEntities")
        {
            this.OnContextCreated();
        }
        public UserManagerEntities(string connectionString) :
                base(connectionString, "UserManagerEntities")
        {
            this.OnContextCreated();
        }
        public UserManagerEntities(global::System.Data.EntityClient.EntityConnection connection) :
                base(connection, "UserManagerEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        public global::System.Data.Objects.ObjectQuery<Employee> Employee
        {
            get
            {
                if ((this._Employee == null))
                {
                    this._Employee = base.CreateQuery<Employee>("[Employee]");
                }
                return this._Employee;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Employee> _Employee;
        public void AddToEmployee(Employee employee)
        {
            base.AddObject("Employee", employee);
        }
    }


其中的一行代码:
this._Employee = base.CreateQuery<Employee>("[Employee]");

中括号里的参数"[Employee]"该怎么理解呢:
按照MSDN中的解释,这里需要两个参数的:
public ObjectQuery<T> CreateQuery<T>(
 string queryString,
 params ObjectParameter[] parameters
)

类型参数
T
参数
queryString
类型:System..::.String

要执行的查询字符串。

parameters
类型:array<System.Data.Objects..::.ObjectParameter>[]()[]

要传递到查询的参数。

返回值
类型:System.Data.Objects..::.ObjectQuery<(Of <(T>)>)

一个可供执行的对存储区的 ObjectQuery<(Of <(T>)>)。

http://angzi.cnblogs.com/的主页 http://angzi.cnblogs.com/ | 初学一级 | 园豆:195
提问于:2009-07-01 11:08
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册