add support for Db Seeder, Fix GraphQL Generic Usage ...
This commit is contained in:
+283
-84
@@ -99,13 +99,23 @@ namespace xDataService.Models
|
||||
/// Repository Data Access Design Pattern ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public Type RepositoryService { get; set; }
|
||||
public Type RepositoryService { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Repository Data Access Design Pattern ...
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public Type RepositoryImplementation { get; set; }
|
||||
public Type RepositoryImplementation { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Database Data Seeder ...
|
||||
/// </summary>
|
||||
public Type SeederService { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Database Data Seeder ...
|
||||
/// </summary>
|
||||
public Type SeederImplementation { get; set; } = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -128,9 +138,9 @@ namespace xDataService.Models
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation
|
||||
> : XRepositoryDescriptor<TEntity, TKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
@@ -149,16 +159,16 @@ namespace xDataService.Models
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation
|
||||
>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
@@ -179,24 +189,24 @@ namespace xDataService.Models
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
@@ -227,32 +237,32 @@ namespace xDataService.Models
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XInMemoryRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TRepositoryImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
@@ -265,7 +275,7 @@ namespace xDataService.Models
|
||||
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
|
||||
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
|
||||
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TRepositoryImplementation : XBaseInMemoryRepositoy<TEntity, TKey>
|
||||
where TRepositoryImplementation : XBaseInMemoryRepository<TEntity, TKey>
|
||||
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
{
|
||||
@@ -277,36 +287,98 @@ namespace xDataService.Models
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XInMemoryRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TRepositoryImplementation,
|
||||
TSeederService,
|
||||
TSeederImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
where TGraphKey : IGraphType
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TGraph : XBaseGraphObjectType<TEntity, TKey>
|
||||
where TSeederService : IXBaseDbSeeder<TEntity, TKey>
|
||||
where TEventsService : IXBaseRepositoryEvents<TEntity>
|
||||
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
|
||||
where TRepositoryService : IXBaseRepository<TEntity, TKey>
|
||||
where TSeederImplementation : XBaseDbSeeder<TEntity, TKey>
|
||||
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
|
||||
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
|
||||
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TRepositoryImplementation : XBaseInMemoryRepository<TEntity, TKey>
|
||||
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
{
|
||||
public XInMemoryRepositoryDescriptor() : base()
|
||||
{
|
||||
//
|
||||
SeederService = typeof(TSeederService);
|
||||
SeederImplementation = typeof(TSeederImplementation);
|
||||
|
||||
//
|
||||
RepositoryService = typeof(TRepositoryService);
|
||||
RepositoryImplementation = typeof(TRepositoryImplementation);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XMongoRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TRepositoryImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
@@ -331,6 +403,68 @@ namespace xDataService.Models
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XMongoRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TRepositoryImplementation,
|
||||
TSeederService,
|
||||
TSeederImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
where TGraphKey : IGraphType
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TGraph : XBaseGraphObjectType<TEntity, TKey>
|
||||
where TSeederService : IXBaseDbSeeder<TEntity, TKey>
|
||||
where TEventsService : IXBaseRepositoryEvents<TEntity>
|
||||
where TSeederImplementation : XBaseDbSeeder<TEntity, TKey>
|
||||
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
|
||||
where TRepositoryService : IXBaseRepository<TEntity, TKey>
|
||||
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
|
||||
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
|
||||
where TRepositoryImplementation : XBaseMongoRepository<TEntity, TKey>
|
||||
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
{
|
||||
public XMongoRepositoryDescriptor() : base()
|
||||
{
|
||||
//
|
||||
SeederService = typeof(TSeederService);
|
||||
SeederImplementation = typeof(TSeederImplementation);
|
||||
|
||||
//
|
||||
RepositoryService = typeof(TRepositoryService);
|
||||
RepositoryImplementation = typeof(TRepositoryImplementation);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
@@ -356,12 +490,12 @@ namespace xDataService.Models
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
@@ -387,4 +521,69 @@ namespace xDataService.Models
|
||||
RepositoryImplementation = typeof(TRepositoryImplementation);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// a Repository Descriptor ...
|
||||
/// </summary>
|
||||
public class XEFRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema,
|
||||
TRepositoryService,
|
||||
TRepositoryImplementation,
|
||||
TContext,
|
||||
TSeederService,
|
||||
TSeederImplementation
|
||||
> : XRepositoryDescriptor<
|
||||
TEntity,
|
||||
TKey,
|
||||
TKeyGeneratorService,
|
||||
TKeyGeneratorImplementation,
|
||||
TEventsService,
|
||||
TEventsImplementation,
|
||||
TGraph,
|
||||
TGraphKey,
|
||||
TGraphQuery,
|
||||
TGraphTypeHelperService,
|
||||
TGraphTypeHelperImplementation,
|
||||
TGraphSchema
|
||||
>
|
||||
where TGraphSchema : Schema
|
||||
where TContext : XDbContext
|
||||
where TGraphKey : IGraphType
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TGraph : XBaseGraphObjectType<TEntity, TKey>
|
||||
where TSeederService : IXBaseDbSeeder<TEntity, TKey>
|
||||
where TEventsService : IXBaseRepositoryEvents<TEntity>
|
||||
where TSeederImplementation : XBaseDbSeeder<TEntity, TKey>
|
||||
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
|
||||
where TRepositoryService : IXBaseRepository<TEntity, TKey>
|
||||
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
|
||||
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
|
||||
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TRepositoryImplementation : XBaseEFRepository<TEntity, TKey, TContext>
|
||||
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
{
|
||||
public XEFRepositoryDescriptor() : base()
|
||||
{
|
||||
//
|
||||
SeederService = typeof(TSeederService);
|
||||
SeederImplementation = typeof(TSeederImplementation);
|
||||
|
||||
//
|
||||
Context = typeof(TContext);
|
||||
RepositoryService = typeof(TRepositoryService);
|
||||
RepositoryImplementation = typeof(TRepositoryImplementation);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user