语言

MigrationsCodeGenerator.GenerateSnapshot 方法

定义

重载

名称 说明
GenerateSnapshot(String, Type, String, IModel)

生成模型快照代码。

GenerateSnapshot(String, Type, String, IModel, String)

生成模型快照代码。

GenerateSnapshot(String, Type, String, IModel)

Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs
Source:
MigrationsCodeGenerator.cs

生成模型快照代码。

public abstract string GenerateSnapshot(string modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
public abstract string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model);
abstract member GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel -> string
Public MustOverride Function GenerateSnapshot (modelSnapshotNamespace As String, contextType As Type, modelSnapshotName As String, model As IModel) As String

参数

modelSnapshotNamespace
String

模型快照的命名空间。

contextType
Type

模型快照 DbContext 的类型。

modelSnapshotName
String

模型快照的名称。

model
IModel

模型。

返回

模型快照代码。

实现

适用于

GenerateSnapshot(String, Type, String, IModel, String)

Source:
MigrationsCodeGenerator.cs

生成模型快照代码。

public abstract string GenerateSnapshot(string? modelSnapshotNamespace, Type contextType, string modelSnapshotName, Microsoft.EntityFrameworkCore.Metadata.IModel model, string? latestMigrationId = default);
abstract member GenerateSnapshot : string * Type * string * Microsoft.EntityFrameworkCore.Metadata.IModel * string -> string
Public MustOverride Function GenerateSnapshot (modelSnapshotNamespace As String, contextType As Type, modelSnapshotName As String, model As IModel, Optional latestMigrationId As String = Nothing) As String

参数

modelSnapshotNamespace
String

模型快照的命名空间。

contextType
Type

模型快照 DbContext 的类型。

modelSnapshotName
String

模型快照的名称。

model
IModel

模型。

latestMigrationId
String

已应用于模型的最新迁移的 ID。

返回

模型快照代码。

实现

适用于