SqlServerModelExtensions.SetIdentitySeed Method

Definition

Overloads

SetIdentitySeed(IConventionModel, Nullable<Int64>, Boolean)

Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs

Sets the default identity seed.

C#
public static long? SetIdentitySeed (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, long? seed, bool fromDataAnnotation = false);

Parameters

model
IConventionModel

The model.

seed
Nullable<Int64>

The value to set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0

SetIdentitySeed(IConventionModel, Nullable<Int32>, Boolean)

Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs

Sets the default identity seed.

C#
public static void SetIdentitySeed (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, int? seed, bool fromDataAnnotation = false);
C#
public static int? SetIdentitySeed (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, int? seed, bool fromDataAnnotation = false);

Parameters

model
IConventionModel

The model.

seed
Nullable<Int32>

The value to set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Applies to

Entity Framework Core 5.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0

SetIdentitySeed(IMutableModel, Nullable<Int32>)

Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs

Sets the default identity seed.

C#
public static void SetIdentitySeed (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, int? seed);

Parameters

model
IMutableModel

The model.

seed
Nullable<Int32>

The value to set.

Applies to

Entity Framework Core 5.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0

SetIdentitySeed(IMutableModel, Nullable<Int64>)

Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs
Source:
SqlServerModelExtensions.cs

Sets the default identity seed.

C#
public static void SetIdentitySeed (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, long? seed);

Parameters

model
IMutableModel

The model.

seed
Nullable<Int64>

The value to set.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0