Entity Framework: Stored Procedure – Function import
09-Jul-1111 Leave a comment
How to…get a stored procedure from SQL and use it in code
In this case execute only, not entity CRUD
- Model Browser
- Stored Procedure
- Right-click
- Update Model from database
- Get your stored procedure
- However at this point still unusable in code
- Not obvious step > Double click Stored Procedure
- Choose function import options
- OK creates function import which is then useable in code
- Note all parameters are surpisingly nullable – May be there is a way preventing this. Unsolved
Enjoy !