src/Shared/EntityFramework/ModelConfiguration/Conventions/Edm/StoreGeneratedIdentityKeyConvention.cs
// <summary>
// Checks for the PK property being an FK in a different table. A PK which is also an FK but
// in the same table is used for table splitting and can still be an identity column because
// the update pipeline is only inserting into one column of one table.
// </summary>
Checks for the PK property being an FK in a different table. A PK which is also an FK but
in the same table is used for table splitting and can still be an identity column because
the update pipeline is only inserting into one column of one table.
Checks for the PK property being an FK in a different table . A PK which is also an FK but in the same table is used for table splitting and can still be an identity column because the update pipeline is only inserting into one column of one table .
private static bool IsNonTableSplittingForeignKey(AssociationType association, EdmProperty property)
        {
            if (association.Constraint != null
                && association.Constraint.ToProperties.Contains(property))
            {
                var sourceConfig = (EntityTypeConfiguration)association.SourceEnd.GetEntityType().GetConfiguration();
                var targetConfig = (EntityTypeConfiguration)association.TargetEnd.GetEntityType().GetConfiguration();
                return sourceConfig == null
                       || targetConfig == null
                       || sourceConfig.GetTableName() == null
                       || targetConfig.GetTableName() == null
                       || !sourceConfig.GetTableName().Equals(targetConfig.GetTableName());
            }
            return false;
        }
private static bool IsNonTableSplittingForeignKey ( AssociationType association , EdmProperty property ) { if ( association . Constraint != null && association . Constraint . ToProperties . Contains ( property ) ) { var sourceConfig = ( EntityTypeConfiguration ) association . SourceEnd . GetEntityType ( ) . GetConfiguration ( ) ; var targetConfig = ( EntityTypeConfiguration ) association . TargetEnd . GetEntityType ( ) . GetConfiguration ( ) ; return sourceConfig == null || targetConfig == null || sourceConfig . GetTableName ( ) == null || targetConfig . GetTableName ( ) == null || ! sourceConfig . GetTableName ( ) . Equals ( targetConfig . GetTableName ( ) ) ; } return false ; }
Checks for the PK property being an FK in a different table.
Checks for the PK property being an FK in a different table .
association
AssociationType
property
EdmProperty