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.ConfigureCatReferenceEntity<TEntity>(this ModelBuilder, string, string) Method

Configures an entity that maps a table owned by someone else. Sets a non-clustered primary key and excludes the table from migrations. Use it to define foreign keys to a table of another service in a shared database.

public static void ConfigureCatReferenceEntity<TEntity>(this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string tableName, string schemaName="dbo")
    where TEntity : Cat.EFCore.Entities.CatReferenceEntityBase;

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. Defaults to dbo.