Table-Valued Functions in Linq to LLBLGen Pro

Posts   
 
    
guaike
User
Posts: 4
Joined: 22-Feb-2011
# Posted on: 25-Mar-2011 06:39:43   

Hi,I have a Table-Valued Function call "FnGetCustomByCountry",and i want to use it in linq query just like linq to sql style:

var custs=from c in metaData.FnGetCustomByCountry("UK") 
where c.City=="London" 
select c

I Didn't found The "Functions" in LLBLGen Desginer but i can see the "Stored Procedures". I don't know is LLBLGen Pro support this feature,or can you tell me how to do?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 25-Mar-2011 10:56:21   

We don't currently support table valued functions, so what you're trying to do isn't supported.

Frans Bouma | Lead developer LLBLGen Pro
guaike
User
Posts: 4
Joined: 22-Feb-2011
# Posted on: 25-Mar-2011 13:51:25   

Hi Otis, Is any plan in a future version support this feature? I think it is useful sometimes.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 25-Mar-2011 21:21:39   

No plans yet. it's a bit complicated because they layout of the function's return table has to be known at code generation time or compile time of the code.

Frans Bouma | Lead developer LLBLGen Pro
guaike
User
Posts: 4
Joined: 22-Feb-2011
# Posted on: 27-Mar-2011 09:44:10   

Hi,If function's return table fields is fixed,can i manually modify the code to support linq?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 27-Mar-2011 11:34:52   

There's no type defined for the resultset returned by the function, so the linq provider doesn't know. Also, the runtime doesn't call functions to obtain data for entity fetches, so I don't see how you can make this work.

Frans Bouma | Lead developer LLBLGen Pro