src/Shared/EntityFramework/ModelConfiguration/Configuration/Types/ConventionTypeConfiguration.cs
/// <summary>
/// Configures the primary key property for this entity type.
/// </summary>
/// <param name="propertyName"> The name of the property to be used as the primary key. </param>
/// <returns>
/// The same <see cref="ConventionTypeConfiguration" /> instance so that multiple calls can be chained.
/// </returns>
Configures the primary key property for this entity type.
Configures the primary key property for this entity type .
public ConventionTypeConfiguration HasKey(string propertyName)
        {
            Check.NotEmpty(propertyName, "propertyName");
            var propertyInfo = _type.GetInstanceProperty(propertyName);
            if (propertyInfo == null)
            {
                throw new InvalidOperationException(Strings.NoSuchProperty(propertyName, _type.Name));
            }
            return HasKey(propertyInfo);
        }
public ConventionTypeConfiguration HasKey ( string propertyName ) { Check . NotEmpty ( propertyName , " " ) ; var propertyInfo = _type . GetInstanceProperty ( propertyName ) ; if ( propertyInfo == null ) { throw new InvalidOperationException ( Strings . NoSuchProperty ( propertyName , _type . Name ) ) ; } return HasKey ( propertyInfo ) ; }
Configures the primary key property for this entity type.
Configures the primary key property for this entity type .
The same  instance so that multiple calls can be chained.
The same instance so that multiple calls can be chained .
propertyName
string
The name of the property to be used as the primary key.
The name of the property to be used as the primary key .