MigrationsSqlGenerator.TryGetVersion(IModel, String) Method

Definition

Gets the product version used to generate the current migration. Providers can use this to preserve compatibility with migrations generated using previous versions.

C#
protected virtual bool TryGetVersion (Microsoft.EntityFrameworkCore.Metadata.IModel model, out string version);
C#
protected virtual bool TryGetVersion (Microsoft.EntityFrameworkCore.Metadata.IModel? model, out string? version);

Parameters

model
IModel

The target model.

version
String

The version.

Returns

true if the version could be retrieved.

Applies to

Product Versions
Entity Framework Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0