Upgrading to Fluent from Model

Thread is closed for posting
2 posts, 0 answers
  1. Jeff
    Jeff avatar
    6 posts
    Member since:
    Jul 2010

    Posted 05 Oct 2016 Link to this post

    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
    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.  



  2. Doroteya
    Doroteya avatar
    498 posts

    Posted 10 Oct 2016 Link to this post

    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.

    Telerik by Progress
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top