Function Imports in Entity Model with a non-Entity Return Type

前端 未结 3 1301
闹比i
闹比i 2020-12-11 03:56

I have a stored procedure in my Entity Data Model and added it to the function imports.

Problem is... Visual Studio generates the function code in the model\'s code-

3条回答
  •  爱一瞬间的悲伤
    2020-12-11 04:38

    It's not so much a bug as it is the lack of a feature. The Entity Framework just doesn't support stored procedures returning scalar values right now. I believe this is supposed to change in .NET 4.0. In the meantime, you can execute such a stored procedure by using the store connection, available via CreateDbCommand.

提交回复
热议问题