Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using User Defined Table Types as Sproc Parameters in EF

Does the current version of EF support user defined table types for Insert, Update and Delete methods on Entities?

I would like to use this feature so I don't have to pass in every column name to my sproc. I am not sure if EF can support one Sproc that would do all the updates for an entity though.

like image 521
Vaccano Avatar asked Mar 15 '26 11:03

Vaccano


2 Answers

Table valued parameters are not supported but you can vote for them in UserVoice.

like image 110
Ladislav Mrnka Avatar answered Mar 18 '26 08:03

Ladislav Mrnka


I tried this out. When I tried to import the sproc into my model I get this error message:

The function 'MySproc' has a parameter 'MyTableValuedParameter' at parameter index 0 that has a data type 'table type' which is not supported. The function was excluded.

So it would seem that the answer is no. They are not supported in Entity Framework.

like image 25
Vaccano Avatar answered Mar 18 '26 08:03

Vaccano