View on GitHub
Clean Architecture Toolkit for .NET
Clean Architecture Toolkit is a clean, modular architecture foundation for .NET applications.
It embraces SOLID principles and focuses on maintainability, testability, and scalability through clear boundaries and pluggable design.

|   HOME   |   MODULE OVERVIEW   |   DEMO   |   CAT.EFCORE   |

Code Reference

» Cat.EFCore.Extensions Assembly » Cat.EFCore.Extensions Namespace » ModelBuilderExtensions Class

ModelBuilderExtensions.ConfigureCatEntity Method

Overloads  
ConfigureCatEntity<TEntity>(this ModelBuilder, string, string, Action<EntityTypeBuilder<TEntity>>) Configures an entity with an explicit table name and schema.
ConfigureCatEntity<TEntity>(this ModelBuilder, string, string, Action<EntityTypeBuilder<TEntity>>, Action<TableBuilder<TEntity>>)  
ConfigureCatEntity<TEntity>(this ModelBuilder, string, Action<EntityTypeBuilder<TEntity>>) Configures an entity with an explicit table name. The schema comes from the model and falls back to dbo.
ConfigureCatEntity<TEntity>(this ModelBuilder, Action<EntityTypeBuilder<TEntity>>) Configures an entity with the table name and schema already known to the model. The schema falls back to dbo. Sets the non-clustered primary key on Id and a unique clustered index on the identity column SequenceId.

ModelBuilderExtensions.ConfigureCatEntity<TEntity>(this ModelBuilder, string, string, Action<EntityTypeBuilder<TEntity>>) Method

Configures an entity with an explicit table name and schema.

public static void ConfigureCatEntity<TEntity>(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string tableName, string schemaName, System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>? entityTypeBuildAction=null)
    where TEntity : Cat.EFCore.Entities.CatEntityBase;

Type parameters

TEntity

The entity type.

Parameters

modelBuilder Microsoft.EntityFrameworkCore.ModelBuilder

The model builder to configure.

tableName System.String

The name of the table.

schemaName System.String

The name of the schema.

entityTypeBuildAction System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>

Optional extra configuration for the entity.

ModelBuilderExtensions.ConfigureCatEntity<TEntity>(this ModelBuilder, string, string, Action<EntityTypeBuilder<TEntity>>, Action<TableBuilder<TEntity>>) Method

private static void ConfigureCatEntity<TEntity>(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string tableName, string schemaName, System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>? entityTypeBuildAction, System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TableBuilder<TEntity>>? tableBuildAction)
    where TEntity : Cat.EFCore.Entities.CatEntityBase;

Type parameters

TEntity

Parameters

modelBuilder Microsoft.EntityFrameworkCore.ModelBuilder

tableName System.String

schemaName System.String

entityTypeBuildAction System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>

tableBuildAction System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.TableBuilder<TEntity>>

ModelBuilderExtensions.ConfigureCatEntity<TEntity>(this ModelBuilder, string, Action<EntityTypeBuilder<TEntity>>) Method

Configures an entity with an explicit table name. The schema comes from the model and falls back to dbo.

public static void ConfigureCatEntity<TEntity>(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string tableName, System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>? entityTypeBuildAction=null)
    where TEntity : Cat.EFCore.Entities.CatEntityBase;

Type parameters

TEntity

The entity type.

Parameters

modelBuilder Microsoft.EntityFrameworkCore.ModelBuilder

The model builder to configure.

tableName System.String

The name of the table.

entityTypeBuildAction System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>

Optional extra configuration for the entity.

ModelBuilderExtensions.ConfigureCatEntity<TEntity>(this ModelBuilder, Action<EntityTypeBuilder<TEntity>>) Method

Configures an entity with the table name and schema already known to the model. The schema falls back to dbo. Sets the non-clustered primary key on Id and a unique clustered index on the identity column SequenceId.

public static void ConfigureCatEntity<TEntity>(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>? entityTypeBuildAction=null)
    where TEntity : Cat.EFCore.Entities.CatEntityBase;

Type parameters

TEntity

The entity type.

Parameters

modelBuilder Microsoft.EntityFrameworkCore.ModelBuilder

The model builder to configure.

entityTypeBuildAction System.Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity>>

Optional extra configuration for the entity.

Exceptions

System.Exception
The entity type has no table name in the model.