1

I am quite new to the Entity Framework, and only have recently started looking into it. I have been using Linq to SQL for sometime now in a C# enviroement and found it really wonderful to use.

Currently I use sqlmetal to generate a DataContext File (Linq to SQL).

Now after some time I thought it would be nice to use to the Entity Framework, (Linq to Entities), I can see that in some respect there are syntatical similarities between the two, i.e. accessing and creating new instances providing the connection string.

However what Im interested in is when the mapping is generated, is there a way to automatically import all the stored procedures, similar to how sqlmetal does it. So that I dont have to import each one individually.

Thank you in advance.

1 Answer 1

2

In the Model Designer (inside Visual Studio, default view option for *.edmx files)

right click --> Update Model from Database

in the "Add" tab of the resulting dialog you can select any or all Stored Procedures.

Edit: Here's a screenshot of the dialog I'm talking about, found at a tutorial at robbagby.com

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much. The tutorial was very helpful. Unfortunately even tho it added all the stored procedures into the Model Store. It didnt add them to the Function Imports. Im guessing there is no real way of getting round this, so will have to add each one individually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.