开发者

Begin to use EDMX Immediately

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜