开发者

Begin to use EDMX Immediately

开发者 https://www.devze.com 2023-02-07 01:05 出处:网络
I have create a table and create edm开发者_开发问答x file, and I create a Stored Procedure that return a single row (select by primary key), and I want the edmx to have a function that calls that SP a

I have create a table and create edm开发者_开发问答x file, and I create a Stored Procedure that return a single row (select by primary key), and I want the edmx to have a function that calls that SP and return a type. How to do it, please help


Select the entity model in design mode. Right click, choose "add", choose "Function import". Now in the dialog you give the procedure a name and choose the procedure from the drop down.

However, if you already have the table in your entity model you can select a single row based on primary key quite easily:

var objectRepresentingSingleRow = yourDataContext.theTable.First(t => t.Id == someId);
0

精彩评论

暂无评论...
验证码 换一张
取 消