我可以在没有Entity Framework的情况下声明dbcontext吗?

时间:2015-11-03 06:08:52

标签: c# entity-framework

我正在构建一个将Entity Framework模型对象转换为另一个对象的工具。新对象应保存为文件。我声明了一个如下对象:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;

namespace CreateBusinessObjectByEF
{
    class BusinessObjectBuilder
    {
        private DbContext db;
        private DbSet dbSet;
    }
}

但字符串DbContextDbSet由红线标记,因为名称空间错误。我已添加对System.Data.Entity的引用,并且我不想添加对Entity Framework的引用,因为我希望我的应用程序可以在所有版本的EF上运行。

那么谁可以帮助我?感谢

0 个答案:

没有答案