ModelCodeGenerator.GenerateModel Method

Definition

Overloads

GenerateModel(IModel, ModelCodeGenerationOptions)

Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs

Generates code for a model.

C#
public abstract Microsoft.EntityFrameworkCore.Scaffolding.ScaffoldedModel GenerateModel (Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions options);

Parameters

model
IModel

The model.

options
ModelCodeGenerationOptions

The options to use during generation.

Returns

The generated model.

Implements

Applies to

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

GenerateModel(IModel, String, String, String, String, ModelCodeGenerationOptions)

Source:
ModelCodeGenerator.cs
Source:
ModelCodeGenerator.cs

Generates code for a model.

C#
public abstract Microsoft.EntityFrameworkCore.Scaffolding.ScaffoldedModel GenerateModel (Microsoft.EntityFrameworkCore.Metadata.IModel model, string namespace, string contextDir, string contextName, string connectionString, Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions options);

Parameters

model
IModel

The model.

namespace
String

The namespace.

contextDir
String

The directory of the DbContext.

contextName
String

The name of the DbContext.

connectionString
String

The connection string.

options
ModelCodeGenerationOptions

The options to use during generation.

Returns

The generated model.

Implements

Applies to

Entity Framework Core 2.2 and Entity Framework Core 2.1
Product Versions
Entity Framework Core 2.1, 2.2