IronPython entity framwork 6 Could not find attribute where

75 views Asked by At

I have successfully integrated entity framework into my project. I'm also able to read data from a table over my dbcontext. But when i try to use the linq where method, i get the following error message: 'DbSet[Workflow]' object has no attribute 'Where'

This is my code:

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          )    

Maybe some one has experiances with linq and ironpython.

Thank you!

1

There are 1 answers

0
BendEg On BEST ANSWER

Found the issues; I had to use import:

import clr
import System
clr.ImportExtensions(System.Linq)