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.