Adds table valued functions support#38
Conversation
|
Where have you been 2 days ago:( I've done exactly the same yesterday. I could save a day wasted on investigation and debugging. Anyway THANK YOU! |
|
Hi, @dkabracadabra. Sorry, I was collecting information 😄 Hope guys will check this soon. We are keen to have this feature! |
|
Hi @roji, is there a chance you will check this PR soon? |
|
I'm really sorry but it's unlikely I'll be able to review this anytime soon... I know the EF6 provider hasn't received much attention recently. @Emill, if you have any time for this that would be great. Otherwise you guys will have to work with your own fork until I have more free time... |
|
Hello @neisbut, |
|
Hi @rwasef1830, done! |
|
@neisbut When I try to run the test under a debugger, I hit many assert failures inside EntityFramework itself: This happens in the constructor of Although the test passes, the asserts mean that some core assumption inside EF is broken. I am not exactly familiar with the gory details of the CSpace and SSpace. Could you check it ? Also, there is a project on GitHub https://github.com/Dixin/EntityFramework.Functions which seems to be adding TVF support to EF in general. Does this work with EntityFramework6.Npgsql ? |
|
@rwasef1830, oh, sorry, I forgot to check this. I made a mistake in function declaration. Fixed now. Could you please try again? Actually my main goal is to support exactly EntityFramework.Functions :) For now it works for scalar function, but not for TVF. EntityFramework.Functions just generates function import code, but Npgsql still need to translate it to SQL. This is what I've implemented in this PR. |
| { | ||
| ParameterTypeSemantics = ParameterTypeSemantics.AllowImplicitConversion, | ||
| Schema = "dbo", | ||
| IsComposable = true, |
There was a problem hiding this comment.
Shouldn't this be IsComposable = false ? Or you can use TVF inside LINQ ? (I'm not familiar with TVFs in general, so I'm just making sure).
There was a problem hiding this comment.
@rwasef1830, that's right, this flag allows to use this inside of LINQ expressions like this:
var query2 = from b in context.GetBlogsByName("blog1") select new { b.Name, Something = 1 };
|
@neisbut The test passes now, just a few questions, formatting nits left. |
| null); | ||
| dbModel.ConceptualModel.Container.AddFunctionImport(getBlogsFuncModel); | ||
|
|
||
| dbModel.ConceptualToStoreMapping.AddFunctionImportMapping(new FunctionImportMappingComposable( |
There was a problem hiding this comment.
@rwasef1830, done, refactored long names.
|
I definitely don't have time to dive into this at the moment... Formatting/cosmetics-wise things look good to me after @rwasef1830's comments, am OK for merging after they're fixed. |
|
@neisbut Thanks for contributing this feature! |
Hello guys, this PR adds support for table valued stored functions.
Please review and let me know what you think. Thanks!