src/Shared/EntityFramework/ModelConfiguration/Configuration/Types/ConventionTypeConfiguration`.cs
/// <summary>
/// Configures the primary key property(s) for this entity type.
/// </summary>
/// <typeparam name="TProperty"> The type of the key. </typeparam>
/// <param name="keyExpression"> A lambda expression representing the property to be used as the primary key. C#: t => t.Id VB.Net: Function(t) t.Id If the primary key is made up of multiple properties then specify an anonymous type including the properties. C#: t => new { t.Id1, t.Id2 } VB.Net: Function(t) New With { t.Id1, t.Id2 } </param>
/// <returns>
/// The same <see cref="ConventionTypeConfiguration{T}" /> instance so that multiple calls can be chained.
/// </returns>
/// <remarks>
/// Calling this will have no effect once it has been configured.
/// </remarks>
Configures the primary key property(s) for this entity type.
Configures the primary key property ( s ) for this entity type .
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public ConventionTypeConfiguration<T> HasKey<TProperty>(Expression<Func<T, TProperty>> keyExpression)
        {
            Check.NotNull(keyExpression, "keyExpression");
            _configuration.HasKey(keyExpression.GetSimplePropertyAccessList().Select(p => p.Single()));
            return this;
        }
[ SuppressMessage ( " " , " " ) ] public ConventionTypeConfiguration < T > HasKey < TProperty > ( Expression < Func < T , TProperty > > keyExpression ) { Check . NotNull ( keyExpression , " " ) ; _configuration . HasKey ( keyExpression . GetSimplePropertyAccessList ( ) . Select ( p => p . Single ( ) ) ) ; 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 .
keyExpression
Expression<Func<T, TProperty>>
A lambda expression representing the property to be used as the primary key. C#: t => t.Id VB.Net: Function(t) t.Id If the primary key is made up of multiple properties then specify an anonymous type including the properties.
A lambda expression representing the property to be used as the primary key . C# : t = > t . Id VB . Net : Function ( t ) t . Id If the primary key is made up of multiple properties then specify an anonymous type including the properties .
typeparam
The type of the key.
The type of the key .
remarks
Calling this will have no effect once it has been configured.
Calling this will have no effect once it has been configured .