Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate function mapping issue #1382

Closed
ErikEJ opened this issue May 6, 2022 · 12 comments
Closed

Investigate function mapping issue #1382

ErikEJ opened this issue May 6, 2022 · 12 comments
Labels
question Further information is requested

Comments

@ErikEJ
Copy link
Owner

ErikEJ commented May 6, 2022

dotnet/efcore#27955

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 8, 2022

@andrey-bulat I do not see a failing stored procedure in your sample reproduction !?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 8, 2022

I think TVP parameters with function mapping is not possible

@andrey-bulat
Copy link

@ErikEJ I updated https://github.com/andrey-bulat/EfCore6Test to show that in EF Core 3.1 TVP in SP work and doesn't work in 6.

Do you know is it supposed to fix it in version 7?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 9, 2022

How is it failing with EF Core 6. There should be no difference..

@andrey-bulat
Copy link

Yes, you are right - when I exclude UDF - it works, error in ValidateDbFunctions - here there is no mapping for TVP, I think that it just because of Udf parameters doesn't know how to map UDT:

In SP generated code contains:
new SqlParameter
{
ParameterName = "LabelIds",
Value = LabelIds ?? Convert.DBNull,
SqlDbType = System.Data.SqlDbType.Structured,
TypeName = "[dbo].[IntListType]",
},

In UDF there is no definition for TypeName

@andrey-bulat
Copy link

@ErikEJ do you know what could be workaround to define DataTable parameter mapping? some interceptors or wrappers?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 9, 2022

What error do you get with the stored procedure??

Full stacktrace pls

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 9, 2022

Finding out is what this issue is about

@andrey-bulat
Copy link

when I exclude UDF, stored procedure works as expected, error is in ValidateDbFunctions

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 9, 2022

OK, so there is no issue with stored procedures in EF Core 6, but the model is invalid due the use of a TVP in the Function mapping. Is that correctly understood?

@ErikEJ
Copy link
Owner Author

ErikEJ commented May 9, 2022

@ajcvickers Assume that using a TVP as parameter is simply not possible with an inline UDF ?

@ErikEJ ErikEJ closed this as completed May 9, 2022
@ErikEJ ErikEJ reopened this May 10, 2022
@ErikEJ
Copy link
Owner Author

ErikEJ commented May 10, 2022

dotnet/efcore#27954

@ErikEJ ErikEJ closed this as completed May 13, 2022
@ErikEJ ErikEJ added the question Further information is requested label May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants