Fix GraphQL Implementation and also UI Playground and add supports for Oracle Provider using EF Core ...
This commit is contained in:
@@ -11,16 +11,17 @@ using xModels.Base;
|
||||
|
||||
namespace xDataService.GraphQL
|
||||
{
|
||||
public abstract class XBaseGraphQLQuery : ObjectGraphType, IXBaseGraphQLQuery { }
|
||||
|
||||
public abstract class XBaseGraphQLQuery<TEntity, TKey> : XBaseGraphQLQuery, IXBaseGraphQLQuery<TEntity, TKey>
|
||||
public abstract class XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey> : ObjectGraphType, IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TGraph : IGraphType
|
||||
where TGraphKey : IGraphType
|
||||
{
|
||||
//
|
||||
protected readonly XDataServiceConfiguration configuration;
|
||||
protected readonly IXBaseRepository<TEntity, TKey> repository;
|
||||
protected readonly IXBaseGraphQLTypeHelper<TEntity, TKey> helper;
|
||||
|
||||
//
|
||||
public XBaseGraphQLQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXBaseRepository<TEntity, TKey> repository,
|
||||
@@ -34,25 +35,7 @@ namespace xDataService.GraphQL
|
||||
|
||||
//
|
||||
Name = GetType().Name;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class XBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey> : XBaseGraphQLQuery<TEntity, TKey>, IXBaseGraphQLQuery<TEntity, TKey, TGraph, TGraphKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
where TGraph : IGraphType
|
||||
where TGraphKey : IGraphType
|
||||
{
|
||||
//
|
||||
public XBaseGraphQLQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXBaseRepository<TEntity, TKey> repository,
|
||||
IXBaseGraphQLTypeHelper<TEntity, TKey> helper
|
||||
) : base(
|
||||
helper: helper,
|
||||
repository: repository,
|
||||
configuration: configuration
|
||||
)
|
||||
{
|
||||
//
|
||||
#region Retrieve ...
|
||||
//
|
||||
|
||||
@@ -5,94 +5,52 @@ using xModels.Base;
|
||||
|
||||
namespace xDataService.GraphQL
|
||||
{
|
||||
public abstract class XBaseGraphQLTypeHelper : IXBaseGraphQLTypeHelper
|
||||
public abstract class XBaseGraphQLTypeHelper<TEntity, TKey> : IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
{
|
||||
//
|
||||
protected readonly XDataServiceConfiguration configuration;
|
||||
private readonly XDataServiceConfiguration configuration;
|
||||
|
||||
//
|
||||
public XBaseGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration
|
||||
XDataServiceConfiguration configuration = null
|
||||
)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
public abstract string GetInQuerySingleName();
|
||||
|
||||
//
|
||||
public abstract string GetInQueryCollectionName();
|
||||
|
||||
//
|
||||
#region Actions ...
|
||||
public virtual string GetCountName()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public virtual string GetExistsName()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public virtual string GetFindManyName()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public virtual string GetFindOneName()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public virtual string GetGraphQLPath(string baseGraphPath = null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public virtual string GetQueryName()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public abstract class XBaseGraphQLTypeHelper<TEntity, TKey> : XBaseGraphQLTypeHelper, IXBaseGraphQLTypeHelper<TEntity, TKey>
|
||||
where TEntity : XBaseEntity<TKey>
|
||||
{
|
||||
//
|
||||
public XBaseGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration = null
|
||||
) : base(configuration)
|
||||
{ }
|
||||
public abstract string GetInQuerySingleName();
|
||||
|
||||
//
|
||||
#region Actions ...
|
||||
public override string GetFindOneName()
|
||||
public string GetFindOneName()
|
||||
{
|
||||
return $"find{GetInQuerySingleName().ToNormalString().Capitalize()}";
|
||||
}
|
||||
|
||||
public override string GetFindManyName()
|
||||
public string GetFindManyName()
|
||||
{
|
||||
return $"find{GetInQueryCollectionName().ToNormalString().Capitalize()}";
|
||||
}
|
||||
|
||||
public override string GetQueryName()
|
||||
public string GetQueryName()
|
||||
{
|
||||
return $"query{GetInQueryCollectionName().ToNormalString().Capitalize()}";
|
||||
}
|
||||
|
||||
public override string GetCountName()
|
||||
public string GetCountName()
|
||||
{
|
||||
return $"count{GetInQueryCollectionName().ToNormalString().Capitalize()}";
|
||||
}
|
||||
|
||||
public override string GetExistsName()
|
||||
public string GetExistsName()
|
||||
{
|
||||
return $"exists{GetInQuerySingleName().ToNormalString().Capitalize()}";
|
||||
}
|
||||
|
||||
public override string GetGraphQLPath(string baseGraphPath = null)
|
||||
public string GetGraphQLPath(string baseGraphPath = null)
|
||||
{
|
||||
//
|
||||
baseGraphPath = baseGraphPath.IsNullOrEmpty() ?
|
||||
@@ -111,6 +69,5 @@ namespace xDataService.GraphQL
|
||||
//
|
||||
return $"{basePath}/{GetInQueryCollectionName().ToNormalString()}";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user