src/Shared/EntityFramework/ModelConfiguration/Configuration/Types/ConventionTypeConfiguration.cs
/// <summary>
/// Configures the primary key property(s) for this entity type.
/// </summary>
/// <param name="keyProperties"> The properties to be used as the primary key. </param>
/// <returns>
/// The same <see cref="ConventionTypeConfiguration" /> instance so that multiple calls can be chained.
/// </returns>
/// <remarks>
/// Calling this will have no effect once it has been configured or if any
/// property does not exist.
/// </remarks>
Configures the primary key property(s) for this entity type.
Configures the primary key property ( s ) for this entity type .
public ConventionTypeConfiguration HasKey(IEnumerable<PropertyInfo> keyProperties)
        {
            Check.NotNull(keyProperties, "keyProperties");
            EntityUtil.CheckArgumentContainsNull(ref keyProperties, "keyProperties");
            EntityUtil.CheckArgumentEmpty(
                ref keyProperties,
                p => Strings.CollectionEmpty(p, "HasKey"), "keyProperties");
            ValidateConfiguration(ConfigurationAspect.HasKey);
            if (_entityTypeConfiguration != null
                && !_entityTypeConfiguration().IsKeyConfigured)
            {
                _entityTypeConfiguration().Key(keyProperties);
            }
            return this;
        }
public ConventionTypeConfiguration HasKey ( IEnumerable < PropertyInfo > keyProperties ) { Check . NotNull ( keyProperties , " " ) ; EntityUtil . CheckArgumentContainsNull ( ref keyProperties , " " ) ; EntityUtil . CheckArgumentEmpty ( ref keyProperties , p => Strings . CollectionEmpty ( p , " " ) , " " ) ; ValidateConfiguration ( ConfigurationAspect . HasKey ) ; if ( _entityTypeConfiguration != null && ! _entityTypeConfiguration ( ) . IsKeyConfigured ) { _entityTypeConfiguration ( ) . Key ( keyProperties ) ; } return this ; }
Configures the primary key property(s) for this entity type.
Configures the primary key property ( s ) for this entity type .
The same  instance so that multiple calls can be chained.
The same instance so that multiple calls can be chained .
keyProperties
IEnumerable<PropertyInfo>
The properties to be used as the primary key.
The properties to be used as the primary key .
remarks
Calling this will have no effect once it has been configured or if any
property does not exist.
Calling this will have no effect once it has been configured or if any property does not exist .