src/Shared/EntityFramework/ModelConfiguration/Conventions/Edm/Db/ColumnOrderingConventionStrict.cs
/// <summary>
/// Validates the ordering configuration supplied for columns to ensure 
/// that the same ordinal was not supplied for two columns.
/// </summary>
/// <param name="table">The name of the table that the columns belong to.</param>
/// <param name="tableName">The definition of the table.</param>
Validates the ordering configuration supplied for columns to ensure
that the same ordinal was not supplied for two columns.
Validates the ordering configuration supplied for columns to ensure that the same ordinal was not supplied for two columns .
protected override void ValidateColumns(EntityType table, string tableName)
        {
            var hasDuplicates
                = table.Properties
                       .Select(c => c.GetOrder())
                       .Where(o => o != null)
                       .GroupBy(o => o)
                       .Any(g => g.Count() > 1);
            if (hasDuplicates)
            {
                throw Error.DuplicateConfiguredColumnOrder(tableName);
            }
        }
protected override void ValidateColumns ( EntityType table , string tableName ) { var hasDuplicates = table . Properties . Select ( c => c . GetOrder ( ) ) . Where ( o => o != null ) . GroupBy ( o => o ) . Any ( g => g . Count ( ) > 1 ) ; if ( hasDuplicates ) { throw Error . DuplicateConfiguredColumnOrder ( tableName ) ; } }
Validates the ordering configuration supplied for columns to ensure
that the same ordinal was not supplied for two columns.
Validates the ordering configuration supplied for columns to ensure that the same ordinal was not supplied for two columns .
table
EntityType
The name of the table that the columns belong to.
The name of the table that the columns belong to .
tableName
string
The definition of the table.
The definition of the table .