Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > ORM Profiler Section > Bugs & Issues> EF6 Code First "Method Not Found" exception
 

Pages: 1
Bugs & Issues
EF6 Code First "Method Not Found" exception
Page:1/1 

  Print all messages in this thread  
Poster Message
basik
User



Location:
London
Joined on:
13-Oct-2014 16:05:35
Posted:
2 posts
# Posted on: 13-Oct-2014 16:22:11.  
I've been trying to get the ORM Profiler 1.5 to work with a simple LINQPad test harness.

Added this to the beginning of the code:
Code:

SD.Tools.OrmProfiler.Interceptor.InterceptorCore.Initialize("Check.App.LinqPad");


Called a single retrieve method. This is using a repository pattern which uses the EF6 as a UnitOfWork.
Code:

MaintenanceAppService mApp = new MaintenanceAppService();
        var model = mApp.GetModelPocoEntities(m=>m.ModelId==2194).FirstOrDefault().Dump("MaintenanceAppService");


I get this error:
Code:

Method not found: 'System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration System.Data.Entity.ModelConfiguration.Configuration. PrimitivePropertyConfiguration. HasDatabaseGeneratedOption(System.Nullable`1<System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption>)'.


Yes, I am using the EF6 context with a connection string passed to the constructor. It seems like the issue here, although this was fixed:
http://forums.ormprofiler.com/Messages.aspx?ThreadID=171&HighLight=1

I also looked at the docs and the CodeFirst work around for V4.1
http://www.ormprofiler.com/documentation/1.5/hh_start.htm


Incidentally I did manage to get the ORM Profiler to work using the same configuration in another LinqPad test harness so I'm happy that the configuration is setup correctly.

Stack trace
Code:

at Company.App.DDD.Infrastructure.Data.Maintenance.Mapping.MaintenanceModelBuilder.MapModel(EntityTypeConfiguration`1 config)
at Company.App.DDD.Infrastructure.Data.Maintenance.Mapping.MaintenanceModelBuilder.BuildModel(DbModelBuilder modelBuilder)
at Company.App.DDD.Infrastructure.Data.Maintenance.UnitOfWork.MaintenanceUnitOfWork.OnModelCreating(DbModelBuilder modelBuilder)
at System.Data.Entity.Internal.LazyInternalContext.CreateModelBuilder()
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at Company.App.DDD.Infrastructure.Data.Common.Repository`1.GetFiltered(Expression`1 filter)
at Company.App.DDD.Infrastructure.Data.Maintenance.Repositories.ModelEntityRepositoryBase.GetModelEntitiesByFilter(Expression`1 whereExpression)


Any suggestions appreciated.

Steven Bense
iVentris Limited
 
Top
Otis
ORM Profiler Team



Location:
The Hague, The Netherlands
Joined on:
22-Aug-2011 10:26:38
Posted:
611 posts
# Posted on: 14-Oct-2014 09:17:43.  
You should use the EF6 specific interceptor assembly. I think I saw the same error several weeks ago when I used accidentally the older EF interceptor. It's a bit of a pain, those different interceptors, though MS has introduced different types with each EF version, hence the different interceptor dlls.

Frans Bouma
ORM Profiler / LLBLGen Pro Lead Developer | Blog | Twitter
 
Top
basik
User



Location:
London
Joined on:
13-Oct-2014 16:05:35
Posted:
2 posts
# Posted on: 15-Oct-2014 17:22:25.  
Thank you. I seem to have the right references. I'll keep digging - same code/different project works, so there must be something amiss.

Steven Bense
iVentris Limited
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.09082011 Final.