From 968bfe0fa037f7cf87c75f8f103043d2cb1f9e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 12 Nov 2025 18:08:41 +0300 Subject: [PATCH] Document EntityName and ProviderName properties of repository --- .../domain-driven-design/repositories.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/en/framework/architecture/domain-driven-design/repositories.md b/docs/en/framework/architecture/domain-driven-design/repositories.md index 433390ffc5..eed0529112 100644 --- a/docs/en/framework/architecture/domain-driven-design/repositories.md +++ b/docs/en/framework/architecture/domain-driven-design/repositories.md @@ -258,6 +258,31 @@ ABP uses dynamic proxying to make these attributes work. There are some rules he In case of you need to check if change tracking is enabled or disabled on a repository object, you can simply read the `IsChangeTrackingEnabled` property. It is `false` by default for read only repositories (see the *Read Only Repositories* section below). It is `null` by default for other repository objects. If it is `null`, change tracking is enabled unless you've explicitly used the change tracking attributes (see the *Attributes for Change Tracking* section). +### The `EntityName` Property + +The `EntityName` property is to set the related entity's name on the repository object in some advanced scenarios. For example, you can use this property to use the [Shared-type entity types](https://learn.microsoft.com/en-us/ef/core/modeling/entity-types?tabs=data-annotations#shared-type-entity-types) feature of Entity Framework Core (it allows you to use a single entity class to work on multiple tables in the database). In other cases, you can just ignore it. + +Default value is `null` unless you explicitly set it. + +**Example usage:** + +````csharp +IRepository _repository; // You can inject it into your class +... +_repository.SetEntityName("Product"); //Set the entity name before using the repository +//use the _repository object as always +```` + +### The `ProviderName` Property + +The `ProviderName` property of a repository object returns the underlying database provider name. It may return one of the following string values for the built-in providers: + +* `Volo.Abp.EntityFrameworkCore` (from the constant `AbpEfCoreConsts.ProviderName` value) +* `Volo.Abp.MongoDB` (from the constant `AbpMongoDbConsts.ProviderName` value) +* `Volo.Abp.MemoryDb` (from the constant `AbpMemoryDbConsts.ProviderName` value) + +This property is not used in most cases. It is mainly available for internal usage of the ABP framework. + ## Other Generic Repository Types Standard `IRepository` interface exposes the standard `IQueryable` and you can freely query using the standard LINQ methods. This is fine for most of the applications. However, some ORM providers or database systems may not support standard `IQueryable` interface. If you want to use such providers, you can't rely on the `IQueryable`.