Entity Framework 6.1

2 posts, 0 answers
  1. Sean
    Sean avatar
    7 posts
    Member since:
    Oct 2012

    Posted 17 Nov 2016 Link to this post

    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. 

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    568 posts

    Posted 22 Nov 2016 Link to this post

    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.
Back to Top