add support for Dynamic Entity Registration in DbContext by Provides IXEntityRegisterar interface and XBaseEntityRegisterar as an abstract Implementation ...

all other requirements handled inside Module.
This commit is contained in:
2026-05-26 22:06:38 +03:30
parent 3d274c347f
commit 1dbda46d4c
8 changed files with 474 additions and 8 deletions
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using xModels.Base;
namespace xDataService.Interfaces
{
/// <summary>
/// an Interface to Intruduce Entities for Dynamic Registration ...
/// </summary>
public interface IXEntityRegisterar
{
/// <summary>
/// Database Name ...
/// </summary>
string Name { get; }
/// <summary>
/// Returns all entity types this plugin wants registered in the DbContext
/// </summary>
IEnumerable<Type> GetEntityTypes();
/// <summary>
/// Optional: Apply additional per-entity configuration
/// </summary>
void ConfigureEntities(ModelBuilder modelBuilder);
/// <summary>
/// Add XDataService Based Entity to List ...
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TKey"></typeparam>
void AddEntity<TEntity, TKey>()
where TEntity : XBaseEntity<TKey>;
}
}