I built my EF Model in EF 4.0, and then installed the 4.1 upgrade that includes the new DBContext interface. How do I update my model so that it uses the 4.1 features going forward?
Thank You
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use DbContext with your EDMX model. After installing EFv4.1 you should have new T4 template available: DbContext generator. This will take your EDMX and create context derived from
DbContextand all POCO entities for you. Here you have walkthrough.But if you want to switch to
DbContextjust because ofDbContext.Entry.Stateyou don’t have to. EFv4 has a similar mechanism:Here is the full description how to update an entity in EFv4.