src/Shared/EntityFramework/Migrations/Builders/TableBuilder.cs
/// <summary>
/// Specifies a primary key for the table.
///
/// Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources 
/// (such as the end user of an application). If input is accepted from such sources it should be validated 
/// before being passed to these APIs to protect against SQL injection attacks etc.
/// </summary>
/// <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>
/// <param name="name"> The name of the primary key. If null is supplied, a default name will be generated. </param>
/// <param name="clustered"> A value indicating whether or not this is a clustered primary key. </param>
/// <param name="anonymousArguments"> Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'. </param>
/// <returns> Itself, so that multiple calls can be chained. </returns>
Specifies a primary key for the table.

Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources
(such as the end user of an application). If input is accepted from such sources it should be validated
before being passed to these APIs to protect against SQL injection attacks etc.
Specifies a primary key for the table . Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources ( such as the end user of an application ) . If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc .
[SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
        [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")]
        [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
        public TableBuilder<TColumns> PrimaryKey(
            Expression<Func<TColumns, object>> keyExpression,
            string name = null,
            bool clustered = true,
            object anonymousArguments = null)
        {
            Check.NotNull(keyExpression, "keyExpression");
            var addPrimaryKeyOperation
                = new AddPrimaryKeyOperation(anonymousArguments)
                    {
                        Name = name,
                        IsClustered = clustered
                    };
            keyExpression
                .GetSimplePropertyAccessList()
                .Select(p => _createTableOperation.Columns.Single(c => c.ApiPropertyInfo == p.Single()))
                .Each(c => addPrimaryKeyOperation.Columns.Add(c.Name));
            _createTableOperation.PrimaryKey = addPrimaryKeyOperation;
            return this;
        }
[ SuppressMessage ( " " , " " ) ] [ SuppressMessage ( " " , " " ) ] [ SuppressMessage ( " " , " " ) ] public TableBuilder < TColumns > PrimaryKey ( Expression < Func < TColumns , object > > keyExpression , string name = null , bool clustered = true , object anonymousArguments = null ) { Check . NotNull ( keyExpression , " " ) ; var addPrimaryKeyOperation = new AddPrimaryKeyOperation ( anonymousArguments ) { Name = name , IsClustered = clustered } ; keyExpression . GetSimplePropertyAccessList ( ) . Select ( p => _createTableOperation . Columns . Single ( c => c . ApiPropertyInfo == p . Single ( ) ) ) . Each ( c => addPrimaryKeyOperation . Columns . Add ( c . Name ) ) ; _createTableOperation . PrimaryKey = addPrimaryKeyOperation ; return this ; }
Specifies a primary key for the table.
Specifies a primary key for the table .
Itself, so that multiple calls can be chained.
Itself so that multiple calls can be chained .
keyExpression
Expression<Func<TColumns, object>>
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 .
name
string
The name of the primary key. If null is supplied, a default name will be generated.
The name of the primary key . If null is supplied a default name will be generated .
clustered
bool
A value indicating whether or not this is a clustered primary key.
A value indicating whether or not this is a clustered primary key .
anonymousArguments
object
Additional arguments that may be processed by providers. Use anonymous type syntax to specify arguments e.g. 'new { SampleArgument = "MyValue" }'.
Additional arguments that may be processed by providers . Use anonymous type syntax to specify arguments e . g . ' new { SampleArgument = " MyValue " } ' .