locked
How to step into EF source code ? RRS feed

  • Question

  • I am getting an error

    One or more validation errors were detected during model generation:
    System.Data.Entity.Edm.EdmAssociationConstraint:
    : The number of properties in the Dependent and Principal Roles in a relationship constraint must be identical.    System.Data.Entity.ModelConfiguration.ModelValidationException

    How to step into the EF code to find what relation is wrong?

    Friday, May 18, 2018 2:40 PM

Answers

  • Hi,

    I would suggest that you could create a database first, then generate related model class and Fluent API, then compare the Fluent API and related Model with yours.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 21, 2018 6:43 AM

All replies

  • Where relationships should have been done is with the database with creating tables and their relationships with using a DBA tool such as MS SQL Server Management Studio. If you would have don that first, you would not be facing the issues you are facing.
    Friday, May 18, 2018 3:00 PM
  • Hi,

    I would suggest that you could create a database first, then generate related model class and Fluent API, then compare the Fluent API and related Model with yours.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 21, 2018 6:43 AM