I try to understand the Mixrosoft mind. Is there a link between the WPF (XAML) DataContext and the Entity Framework Context object? Why calling both of them Context? Is the Entity Framework Context object a WPF DataContext?
Share
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.
No, they are not the same.
WPF DataContext is any object, whose data can be bound to WPF controls.
Entity Framework ObjectContext (DbContext) is a “facade” of ORM.
You can work with WPF without EF and use as DataContext anything. The same, you can use EF and display your data in WinForms… or not display them at all.
I think, MS called them “-Context” because they use in contextual manner for their respective use cases: “Show the data in UI” and “Manipulate with data in database”.