.net IronPython实体framwork 6找不到属性where
我已经成功地将实体框架集成到我的项目中。我还能够通过dbcontext从表中读取数据。但是当我尝试使用linq.net IronPython实体framwork 6找不到属性where,.net,linq,entity-framework,entity-framework-6,ironpython,.net,Linq,Entity Framework,Entity Framework 6,Ironpython,我已经成功地将实体框架集成到我的项目中。我还能够通过dbcontext从表中读取数据。但是当我尝试使用linqwhere方法时,我得到以下错误消息:'DbSet[Workflow]'对象没有属性'where' 这是我的代码: import clr import sys from Framework.EF import MyDbContext, Workflow from System import Console from System.Linq import Enumerable, IQuer
where
方法时,我得到以下错误消息:'DbSet[Workflow]'对象没有属性'where'
这是我的代码:
import clr
import sys
from Framework.EF import MyDbContext, Workflow
from System import Console
from System.Linq import Enumerable, IQueryable
from System import Linq
context = MyDbContext()
Console.WriteLine( context.Workflow.Where(lambda x: x.DisplayName == 'ABC123').ToList()[0].DisplayName )
也许有人对linq和ironpython有经验
谢谢大家! 发现问题;我必须使用导入:
import clr
import System
clr.ImportExtensions(System.Linq)