문제

I'm using EF database first and have added a stored procedure to the database.

When I ran Update model from database on the edmx file it picked up the stored procedure and I selected it as an item I wanted to include.

I have a file named Model<projectname>.Context.cs with a class called Entities in it. This is an auto-generated class and it contains methods for other stored procedures in the system. My new stored procedure does not have a corresponding method in this class and running Run custom tool does not help.

Is there something else that I need to do, that I am not doing?

Thanks,

Sachin

도움이 되었습니까?

해결책

EDMX doesn't support Table-valued parameter. So if your proc uses the TVP as the parameter, the EDMX designer can't pick it up.

Edited:

If you want to retrieve the result set and create object/POCO for the proc, then just simply remove the tvp, compile the proc, let the EDMX designer to pick up your proc, generate the result object and then add the tvp back to your proc. This is a very easy way to cheat the EDMX designer and get what you need.

다른 팁

Ensure you are doing "Run Custom Tool" on the *Model.CONTEXT.tt file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top