SqlServerModelBuilderExtensions SqlServerModelBuilderExtensions Class

Definition

SQL Server specific extension methods for ModelBuilder.

public static class SqlServerModelBuilderExtensions
Public Module SqlServerModelBuilderExtensions
Inheritance
System.ObjectSystem.Object
SqlServerModelBuilderExtensionsSqlServerModelBuilderExtensions

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

ForSqlServerHasSequence(ModelBuilder, String, Action) ForSqlServerHasSequence(ModelBuilder, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, string name, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, name As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerHasSequence(ModelBuilder, String, String) ForSqlServerHasSequence(ModelBuilder, String, String)

Configures a database sequence when targeting SQL Server.

public static RelationalSequenceBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, string name, string schema = null)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, name As String, schema As String = Nothing) As RelationalSequenceBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

Returns

A builder to further configure the sequence.

ForSqlServerHasSequence(ModelBuilder, String, String, Action) ForSqlServerHasSequence(ModelBuilder, String, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, string name, string schema, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, name As String, schema As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerHasSequence(ModelBuilder, Type, String, Action) ForSqlServerHasSequence(ModelBuilder, Type, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, Type clrType, string name, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, clrType As Type, name As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

clrType
System.Type System.Type

The type of values the sequence will generate.

name
System.String System.String

The name of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerHasSequence(ModelBuilder, Type, String, String) ForSqlServerHasSequence(ModelBuilder, Type, String, String)

Configures a database sequence when targeting SQL Server.

public static RelationalSequenceBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, Type clrType, string name, string schema = null)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, clrType As Type, name As String, schema As String = Nothing) As RelationalSequenceBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

clrType
System.Type System.Type

The type of values the sequence will generate.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

Returns

A builder to further configure the sequence.

ForSqlServerHasSequence(ModelBuilder, Type, String, String, Action) ForSqlServerHasSequence(ModelBuilder, Type, String, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence(this ModelBuilder modelBuilder, Type clrType, string name, string schema, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(modelBuilder As ModelBuilder, clrType As Type, name As String, schema As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

clrType
System.Type System.Type

The type of values the sequence will generate.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerHasSequence(ModelBuilder, String, Action) ForSqlServerHasSequence(Of T)(ModelBuilder, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence<T>(this ModelBuilder modelBuilder, string name, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(Of T)(modelBuilder As ModelBuilder, name As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Type Parameters
T

The type of values the sequence will generate.

Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerHasSequence(ModelBuilder, String, String) ForSqlServerHasSequence(Of T)(ModelBuilder, String, String)

Configures a database sequence when targeting SQL Server.

public static RelationalSequenceBuilder ForSqlServerHasSequence<T>(this ModelBuilder modelBuilder, string name, string schema = null)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(Of T)(modelBuilder As ModelBuilder, name As String, schema As String = Nothing) As RelationalSequenceBuilder
Type Parameters
T

The type of values the sequence will generate.

Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

Returns

A builder to further configure the sequence.

ForSqlServerHasSequence(ModelBuilder, String, String, Action) ForSqlServerHasSequence(Of T)(ModelBuilder, String, String, Action(Of RelationalSequenceBuilder))

Configures a database sequence when targeting SQL Server.

public static ModelBuilder ForSqlServerHasSequence<T>(this ModelBuilder modelBuilder, string name, string schema, Action<RelationalSequenceBuilder> builderAction)
<ExtensionAttribute>
Public Shared Function ForSqlServerHasSequence(Of T)(modelBuilder As ModelBuilder, name As String, schema As String, builderAction As Action(Of RelationalSequenceBuilder)) As ModelBuilder
Type Parameters
T

The type of values the sequence will generate.

Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

builderAction
System.Action<RelationalSequenceBuilder> System.Action(Of RelationalSequenceBuilder)

An action that performs configuration of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerUseIdentityColumns(ModelBuilder) ForSqlServerUseIdentityColumns(ModelBuilder)

Configures the model to use the SQL Server IDENTITY feature to generate values for properties marked as OnAdd, when targeting SQL Server. This is the default behavior when targeting SQL Server.

public static ModelBuilder ForSqlServerUseIdentityColumns(this ModelBuilder modelBuilder)
<ExtensionAttribute>
Public Shared Function ForSqlServerUseIdentityColumns(modelBuilder As ModelBuilder) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

Returns

The same builder instance so that multiple calls can be chained.

ForSqlServerUseSequenceHiLo(ModelBuilder, String, String) ForSqlServerUseSequenceHiLo(ModelBuilder, String, String)

Configures the model to use a sequence-based hi-lo pattern to generate values for properties marked as OnAdd, when targeting SQL Server.

public static ModelBuilder ForSqlServerUseSequenceHiLo(this ModelBuilder modelBuilder, string name = null, string schema = null)
<ExtensionAttribute>
Public Shared Function ForSqlServerUseSequenceHiLo(modelBuilder As ModelBuilder, name As String = Nothing, schema As String = Nothing) As ModelBuilder
Parameters
modelBuilder
ModelBuilder ModelBuilder

The model builder.

name
System.String System.String

The name of the sequence.

schema
System.String System.String

The schema of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object