This is a migrated thread and some comments may be shown as answers.

Entity Framework 6.1

1 Answer 177 Views
EntityFrameworkDataSource
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 17 Nov 2016, 07:19 PM

First part of this question: is this control still supported?  I ask because according to http://docs.telerik.com/devtools/wpf/controls/radentityframeworkdatasource/entityframework-changes there hasn't been an update since 2013, yet Entity Framework itself has been updated multiple times since then.

 

The real question is: how to use this with Entity Framework 6.1?

When trying to use this control, I get this at runtime:

Exception thrown: 'System.MissingMethodException' in Telerik.Windows.Controls.EntityFramework.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>Log Manager.vshost.exe</AppDomain><Exception><ExceptionType>System.MissingMethodException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Method not found: 'System.Data.Objects.ObjectContext System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()'.</Message><StackTrace>   at Telerik.Windows.Controls.RadEntityFrameworkDataSource.get_EffectiveObjectContext()

I'm setting the DbContext like this: this.logsSource.DbContext = this.context;

According to http://www.telerik.com/forums/objectcontext-vs-dbcontext the DbContext property just calls ((System.Data.Entity.Infrastructure.IObjectContextAdapter)this.DbContext).ObjectContext;

But I don't think that's correct, as I've tried doing the same thing myself and setting the ObjectContext property, but that property insists that ObjectContext come from System.Data.Objects, so the above line would never work.

 So I'm confused, and looking for suggestions, please. 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 22 Nov 2016, 09:40 AM
Hello Sean,

In order to make your project work with versions of Entity Framework newer than version 5.0, you should reference the Telerik.Windows.Controls.EntityFramework60 assembly instead of the Telerik.Windows.Controls.EntityFramework one. Doing so results in a buildable project at my end which I'm attaching to my reply for your reference.

Could you please try applying the aforementioned modifications and let me know if the issue persists? I will be awaiting your reply.

Regards,
Dilyan Traykov
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Tags
EntityFrameworkDataSource
Asked by
Sean
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or