.net - Creating Entity Framework Objects from Stored Procedures -


when using entity framework 4, how create single entity stored procedure?

after add stored procedure model, model browser right-click stored procedure under store node , select 'add function import'. in dialog, indicate entity should created:

alt text

you can use stored procedure this:

artist = ctx.selectartist(id).singleordefault(); 

edit

based on comments, sounds want use stored procedures perform inserts, updates, , deletes. if right-click on entity in model browser , select 'stored procedure mapping', you'll window lets specify stored procedures use. msdn has walkthrough on how this.

hth


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -