Complete SubCategory Data Models and Implementations ...
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XSubCategoryGraphQLTypeHelper : XBaseGraphQLTypeHelper<XSubCategory, int>, IXSubCategoryGraphQLTypeHelper
|
||||
{
|
||||
public XSubCategoryGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration
|
||||
) : base(configuration)
|
||||
{ }
|
||||
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return "subCategories";
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return "subCategory";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using GraphQL.Types;
|
||||
using xCategoryService.Interfaces.Entities;
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XSubCategoryGraphQuery : XBaseGraphQLQuery<XSubCategory, int, XSubCategoryGraphType, IntGraphType>
|
||||
{
|
||||
public XSubCategoryGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXSubCategoryRepository repository,
|
||||
IXSubCategoryGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XSubCategoryGraphSchema : Schema
|
||||
{
|
||||
public XSubCategoryGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XSubCategoryGraphQuery)services.GetService(typeof(XSubCategoryGraphQuery));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using xCategoryService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xCategoryService.Providers.GraphQL
|
||||
{
|
||||
public class XSubCategoryGraphType : XBaseGraphObjectType<XSubCategory, int>
|
||||
{
|
||||
public XSubCategoryGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.Description);
|
||||
Field(x => x.References);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user