fix GraphQL DI Registration Using Generics ...

This commit is contained in:
2026-05-10 00:12:59 +03:30
parent 49c6872fcf
commit 07f4435f9a
6 changed files with 530 additions and 138 deletions
+134 -23
View File
@@ -69,13 +69,7 @@ namespace xDataService.Models
/// Entity GrapQL Query ...
/// </summary>
/// <value></value>
public Type GraphQueryService { get; set; } = null;
/// <summary>
/// Entity GrapQL Query ...
/// </summary>
/// <value></value>
public Type GraphQueryImplementation { get; set; } = null;
public Type GraphQuery { get; set; } = null;
/// <summary>
/// Repository Event Provider ...
@@ -133,7 +127,12 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation> : XRepositoryDescriptor<TEntity, TKey>
public class XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation
> : XRepositoryDescriptor<TEntity, TKey>
where TEntity : XBaseEntity<TKey>
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
@@ -149,7 +148,19 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation> : XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation>
public class XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation,
TEventsService,
TEventsImplementation
> : XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation
>
where TEntity : XBaseEntity<TKey>
where TEventsService : IXBaseRepositoryEvents<TEntity>
where TKeyGeneratorService : IXKeyGenerator<TEntity, TKey>
@@ -167,7 +178,27 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema> : XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation>
public class XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation,
TEventsService,
TEventsImplementation,
TGraph,
TGraphKey,
TGraphQuery,
TGraphTypeHelperService,
TGraphTypeHelperImplementation,
TGraphSchema
> : XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation,
TEventsService,
TEventsImplementation
>
where TGraphSchema : Schema
where TGraphKey : IGraphType
where TEntity : XBaseEntity<TKey>
@@ -177,19 +208,17 @@ namespace xDataService.Models
where TEventsImplementation : XBaseRepositoryEvents<TEntity>
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
where TGraphQueryService : IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphQueryImplementation : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
{
public XRepositoryDescriptor() : base()
{
//
GraphType = typeof(TGraph);
GraphTypeKey = typeof(TGraphKey);
GraphQuery = typeof(TGraphQuery);
GraphSchema = typeof(TGraphSchema);
GraphQueryService = typeof(TGraphQueryService);
GraphTypeHelperService = typeof(TGraphTypeHelperService);
GraphQueryImplementation = typeof(TGraphQueryImplementation);
GraphTypeHelperImplementation = typeof(TGraphTypeHelperImplementation);
}
}
@@ -197,7 +226,35 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XInMemoryRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema, TRepositoryService, TRepositoryImplementation> : XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema>
public class XInMemoryRepositoryDescriptor<
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,
TGraphSchema
>
where TGraphSchema : Schema
where TGraphKey : IGraphType
where TEntity : XBaseEntity<TKey>
@@ -209,9 +266,8 @@ namespace xDataService.Models
where TKeyGeneratorImplementation : XKeyGenerator<TEntity, TKey>
where TGraphTypeHelperService : IXBaseGraphQLTypeHelper<TEntity, TKey>
where TRepositoryImplementation : XBaseInMemoryRepositoy<TEntity, TKey>
where TGraphQuery : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphTypeHelperImplementation : XBaseGraphQLTypeHelper<TEntity, TKey>
where TGraphQueryService : IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphQueryImplementation : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
{
public XInMemoryRepositoryDescriptor() : base()
{
@@ -224,7 +280,35 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XMongoRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema, TRepositoryService, TRepositoryImplementation> : XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema>
public class XMongoRepositoryDescriptor<
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,
TGraphSchema
>
where TGraphSchema : Schema
where TGraphKey : IGraphType
where TEntity : XBaseEntity<TKey>
@@ -236,9 +320,8 @@ namespace xDataService.Models
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>
where TGraphQueryService : IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphQueryImplementation : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
{
public XMongoRepositoryDescriptor() : base()
{
@@ -251,7 +334,36 @@ namespace xDataService.Models
/// <summary>
/// a Repository Descriptor ...
/// </summary>
public class XEFRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema, TRepositoryService, TRepositoryImplementation, TContext> : XRepositoryDescriptor<TEntity, TKey, TKeyGeneratorService, TKeyGeneratorImplementation, TEventsService, TEventsImplementation, TGraph, TGraphKey, TGraphQueryService, TGraphQueryImplementation, TGraphTypeHelperService, TGraphTypeHelperImplementation, TGraphSchema>
public class XEFRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation,
TEventsService,
TEventsImplementation,
TGraph,
TGraphKey,
TGraphQuery,
TGraphTypeHelperService,
TGraphTypeHelperImplementation,
TGraphSchema,
TRepositoryService,
TRepositoryImplementation,
TContext
> : XRepositoryDescriptor<
TEntity,
TKey,
TKeyGeneratorService,
TKeyGeneratorImplementation,
TEventsService,
TEventsImplementation,
TGraph,
TGraphKey,
TGraphQuery,
TGraphTypeHelperService,
TGraphTypeHelperImplementation,
TGraphSchema
>
where TGraphSchema : Schema
where TContext : XDbContext
where TGraphKey : IGraphType
@@ -263,10 +375,9 @@ namespace xDataService.Models
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>
where TGraphQueryService : IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
where TGraphQueryImplementation : XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
{
public XEFRepositoryDescriptor() : base()
{