我有几个 ef 实体类(第一个生成的数据库)。我仅限于使用 EF 3.5 我需要从存储库接口返回一个通用类型 - 尝试使用在部分实体类中扩展的自定义接口但没有工作 -
我的一些代码:
存储库接口:
interface IRepository
{
List<string> GetColumnNames();
IQueryable<EntityObject> GetAll();//what common type/interface can I return here?
}
存储库类:我有几个
class CatalogItemRepository:IRepository
{
private string repositoryName="CatalogItem";
public List<string> GetColumnNames()
{
//implementation
}
public IQueryable<CatalogItem> GetAll()
{
//implementation
}
}
实体类