Skip to content

Add EntityManagerBuilder for entity-specific service configuration#105

Merged
tsutomi merged 7 commits into
mainfrom
entity-manager-refactoring
Jun 7, 2026
Merged

Add EntityManagerBuilder for entity-specific service configuration#105
tsutomi merged 7 commits into
mainfrom
entity-manager-refactoring

Conversation

@tsutomi

@tsutomi tsutomi commented Jun 5, 2026

Copy link
Copy Markdown
Member

This pull request significantly expands and clarifies the documentation for the EntityManager and related features in the Kista data access framework. The main focus is on improving guidance for entity validation, caching, error handling, and registration patterns using the new fluent builder APIs. The docs now provide more concrete examples, recommended practices, and "see also" references for discoverability.

Key documentation improvements:

EntityManager usage & registration

  • The EntityManager documentation (entity-manager/README.md) was rewritten to clarify its purpose, available features (validation, caching, error handling, etc.), and the recommended registration patterns using the fluent builder API (WithManagement()). It now covers both per-repository and global manager registration, and explains package dependencies and DI setup.
  • Added a new section on custom managers, showing how to derive from EntityManager<TEntity> and register custom logic in DI, as well as a detailed explanation of the OperationResult pattern for error handling.

Entity validation & error factories

  • Introduced a new page, entity-validation.md, documenting how to implement, register, and use entity validators (IEntityValidator<TEntity>) and custom error factories (OperationErrorFactory). This includes examples for both the fluent builder and legacy registration, and explains the error handling flow in detail.
  • Linked the new validation page from the main summary and from related docs for discoverability. [1] [2] [3]

Caching enhancements

  • Expanded the caching documentation to show how to configure EasyCaching globally, use the new WithEasyCaching() fluent builder methods (per-repository and global), and customize cache key generation with IEntityCacheKeyGenerator<>. Deprecated legacy registration methods in favor of the builder pattern. [1] [2]
  • Added sections on cache invalidation behavior, cache key formats, and serialization strategies for distributed caches. [1] [2]

General improvements and clarifications

  • Updated the main index and custom repository registration docs to clarify how open-generic and concrete repository registrations interact, and to provide more practical code examples. [1] [2]
  • Added or improved "See Also" links throughout the docs for easier navigation between related topics. [1] [2] [3]

Most important changes:

EntityManager registration and usage

  • Rewrote entity-manager/README.md to clarify EntityManager features, explain per-repository and global registration using the fluent builder API, and detail package dependencies and DI setup.
  • Added detailed guidance on deriving custom managers and using the OperationResult pattern for structured error handling.

Entity validation and error handling

  • Added new entity-validation.md page documenting validator and error factory implementation, registration, and integration with the EntityManager, including best practices and code samples.
  • Linked validation documentation from the summary and other relevant docs for discoverability. [1] [2] [3]

Caching configuration and customization

  • Expanded caching docs to show EasyCaching global setup, per-repository and global WithEasyCaching() usage, cache key customization, and deprecated legacy registration methods. [1] [2]
  • Added sections on cache invalidation, cache key formats, and serialization strategies for distributed caches. [1] [2]

General documentation improvements

  • Clarified open-generic vs. concrete repository registration in the main index and custom repository docs, with improved code examples. [1] [2]
  • Added or improved "See Also" links to connect related documentation topics. [1] [2] [3]

@tsutomi tsutomi self-assigned this Jun 5, 2026
@tsutomi tsutomi added enhancement New feature or request manager Issues related to the Entity Manager inmemory Issues that concern the In-Memory repository implementaiton caching labels Jun 5, 2026
Comment thread src/Kista.Manager/EntityManagerBuilder.cs Fixed
Comment thread src/Kista.Manager/EntityManagerBuilder.cs Fixed
tsutomi added 2 commits June 5, 2026 15:39
Address PR review comments: filter interfaces with Where()
and project to entity type with Select() instead of inline
guards and variable assignment in loops.
Comment thread src/Kista.Manager/EntityManagerBuilder.cs Fixed
tsutomi and others added 4 commits June 5, 2026 16:37
…ssionCache and BoundedFilterCache to inherit from it
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@tsutomi tsutomi merged commit 850e39d into main Jun 7, 2026
13 checks passed
@tsutomi tsutomi deleted the entity-manager-refactoring branch June 7, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caching enhancement New feature or request inmemory Issues that concern the In-Memory repository implementaiton manager Issues related to the Entity Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant