English 中文(简体)
从linq2sql到EF4.0
原标题:Migration from linq2sql to EF4.0

在linq2sql,我有这部法律实施存放地基级。

    public abstract class Repository<T> : IRepository<T> where T : class {
        protected DataContext context;
        protected Table<T> table;

        public Repository (DataContext context)
        {
            this.context = context;
            table = context.GetTable<T> ();
        }

        public IQueryable<T> FindAll ()
        {
            return table;
        }

        public IQueryable<T> FindAll(Func<T, bool> exp)
        {
            return table.Where(exp).AsQueryable();
        }
}

现在,我需要移徙到欧洲复兴开发银行4.0。

一切都属于罚款和简单,BUT I可找到GetTable(或类似)方法<>ObjectContext。

救助

最佳回答

页: 1 创建ObjectSet<T>。

问题回答

暂无回答




相关问题
LINQ to SQL as databinding source for WPF Treeview

I wonder if someone could provide a simple example of the following. (preferably in VB.Net): I have an SQL database with related tables and I am successfully using LINQ to SQL in other areas of my ...

Linq to SQL insert/select foreign/primary records

I have table A and Table B. Table B contains two columns, Name and ID. Table A contains several columns and a foreign key column pointing to B.ID called B_ID On the client side, I have all the data I ...

LINQ to SQL Dynamic Sort question

How do I code the Select clause in my LINQ satament to select column aliases so I can sort on them basically I want to accomplish this SQL statement in LINQ: select type_id as id, ...

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签