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

Upgrading to Fluent from Model

1 Answer 90 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 05 Oct 2016, 04:59 PM

I was previously using Data Access 2015.1.225.1 for a few projects that are large enough that I don't want to rewrite the data access if possible. Each project consists of 150-600 tables.  I decided to see if I can convert my smallest project ~170 tables to a fluent model so I can utilize a more current version of data access and avoid some other issues I have encountered.  http://www.telerik.com/forums/insert-fails-with-bigint#1syPBFdMj028DwWYSALcVw.  I tried following the blog post, http://www.telerik.com/blogs/benefits-of-code-only-mapping-and-how-to-get-them, to do my conversion.  Once I created the fluent code I tried to compile my project but I got the error below.  

Error17Value cannot be null.
Parameter name: persistentType
ExceptionString:
System.ArgumentNullException: Value cannot be null.
Parameter name: persistentType
   at Telerik.OpenAccess.Metadata.Fluent.NavigationPropertyConfiguration.FindMetaMember(MetaPersistentType persistentType, MemberInfo targetMemberInfo)
   at Telerik.OpenAccess.Metadata.Fluent.ForeignKeyAssociationFactory.CalculateForeignKeyConstraintColumns(Type entityType, FluentMetadataSource fluentMappingSource)
   at Telerik.OpenAccess.Metadata.Fluent.ForeignKeyAssociationFactory`2.AddMetaConstraint(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer)
   at Telerik.OpenAccess.Metadata.Fluent.NavigationPropertyConfiguration.AddRelationalItem(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer, MetaTable table)
   at Telerik.OpenAccess.Metadata.Fluent.MappingConfiguration.AddMasterAssociationMapping(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer)
   at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.ProcessAssociations(MetadataContainer metadataContainer)
   at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.CreateModel()
   at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.GetModelCore(MetadataContainer old)
   at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
   at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()E:\Projects\Test\WebApplication3\TeacherTalk.Model.Fluent\obj\Debug\TeacherTalk.Model.Fluent.dllTeacherTalk.Model.Fluent

 

I found the forum post, http://www.telerik.com/forums/value-cannot-be-null-parameter-name-persistenttype, that describes the same error and the solution states that it is a problem with one of the relationships.  I was wondering if there is any way to better determine which relationship because the project works correctly when using the XML code generation.  

 

 

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 10 Oct 2016, 02:26 PM
Hello Jeff,

I'm sorry for the inconvenience you are experiencing.

At this point, it is our opinion that the error you are experiencing is a bug in Data Access. We are going to perform an investigation on our side and I'll make sure to update you in this thread.

Thank you in advance for your understanding.

Regards,
Doroteya
Telerik by Progress
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Data Access Free Edition
Asked by
Jeff
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or