.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:
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
Post a Comment