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:
@@ -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>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user