From b6ed60b0e7020e3e064274af47e72374896c1f4d Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 7 Dec 2025 13:22:49 +0330 Subject: [PATCH] Add Entities and Repositories ... --- DataHelper/Events/XTagEvents.cs | 9 +++++++ DataHelper/GraphQL/XTagGraphQLTypeHelper.cs | 25 +++++++++++++++++++ DataHelper/GraphQL/XTagGraphQuery.cs | 22 ++++++++++++++++ DataHelper/GraphQL/XTagGraphSchema.cs | 13 ++++++++++ DataHelper/GraphQL/XTagGraphType.cs | 14 +++++++++++ Interfaces/Entities/IXTagEvents.cs | 8 ++++++ Interfaces/Entities/IXTagGraphQLTypeHelper.cs | 8 ++++++ Interfaces/Entities/IXTagRepository.cs | 8 ++++++ .../xTagService.AssemblyInfo.cs | 2 +- 9 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 DataHelper/Events/XTagEvents.cs create mode 100644 DataHelper/GraphQL/XTagGraphQLTypeHelper.cs create mode 100644 DataHelper/GraphQL/XTagGraphQuery.cs create mode 100644 DataHelper/GraphQL/XTagGraphSchema.cs create mode 100644 DataHelper/GraphQL/XTagGraphType.cs create mode 100644 Interfaces/Entities/IXTagEvents.cs create mode 100644 Interfaces/Entities/IXTagGraphQLTypeHelper.cs create mode 100644 Interfaces/Entities/IXTagRepository.cs diff --git a/DataHelper/Events/XTagEvents.cs b/DataHelper/Events/XTagEvents.cs new file mode 100644 index 0000000..b897cf2 --- /dev/null +++ b/DataHelper/Events/XTagEvents.cs @@ -0,0 +1,9 @@ +using xDataService.Events; +using xTagService.Interfaces.Entities; +using xTagService.Models.Entities; + +namespace xTagService.DataHelper.Events +{ + public class XTagEvents : XBaseRepositoryEvents, IXTagEvents + { } +} \ No newline at end of file diff --git a/DataHelper/GraphQL/XTagGraphQLTypeHelper.cs b/DataHelper/GraphQL/XTagGraphQLTypeHelper.cs new file mode 100644 index 0000000..34d9e41 --- /dev/null +++ b/DataHelper/GraphQL/XTagGraphQLTypeHelper.cs @@ -0,0 +1,25 @@ +using xDataService.Configuration; +using xDataService.GraphQL; +using xTagService.Interfaces.Entities; +using xTagService.Models.Entities; + +namespace xTagService.DataHelper.GraphQL +{ + public class XTagGraphQLTypeHelper : XBaseGraphQLTypeHelper, IXTagGraphQLTypeHelper + { + public XTagGraphQLTypeHelper( + XDataServiceConfiguration configuration + ) : base(configuration) + { } + + public override string GetInQueryCollectionName() + { + return "tags"; + } + + public override string GetInQuerySingleName() + { + return "tag"; + } + } +} \ No newline at end of file diff --git a/DataHelper/GraphQL/XTagGraphQuery.cs b/DataHelper/GraphQL/XTagGraphQuery.cs new file mode 100644 index 0000000..d7c1d78 --- /dev/null +++ b/DataHelper/GraphQL/XTagGraphQuery.cs @@ -0,0 +1,22 @@ +using GraphQL.Types; +using xDataService.Configuration; +using xDataService.GraphQL; +using xTagService.Interfaces.Entities; +using xTagService.Models.Entities; + +namespace xTagService.DataHelper.GraphQL +{ + public class XTagGraphQuery : XBaseGraphQLQuery + { + public XTagGraphQuery( + XDataServiceConfiguration configuration, + IXTagRepository repository, + IXTagGraphQLTypeHelper helper + ) : base( + configuration, + repository, + helper + ) + { } + } +} \ No newline at end of file diff --git a/DataHelper/GraphQL/XTagGraphSchema.cs b/DataHelper/GraphQL/XTagGraphSchema.cs new file mode 100644 index 0000000..e4af12e --- /dev/null +++ b/DataHelper/GraphQL/XTagGraphSchema.cs @@ -0,0 +1,13 @@ +using System; +using GraphQL.Types; + +namespace xTagService.DataHelper.GraphQL +{ + public class XTagGraphSchema : Schema + { + public XTagGraphSchema(IServiceProvider services) : base(services) + { + Query = (XTagGraphQuery)services.GetService(typeof(XTagGraphQuery)); + } + } +} \ No newline at end of file diff --git a/DataHelper/GraphQL/XTagGraphType.cs b/DataHelper/GraphQL/XTagGraphType.cs new file mode 100644 index 0000000..f45f1bc --- /dev/null +++ b/DataHelper/GraphQL/XTagGraphType.cs @@ -0,0 +1,14 @@ +using xDataService.GraphQL; +using xTagService.Models.Entities; + +namespace xTagService.DataHelper.GraphQL +{ + public class XTagGraphType : XBaseGraphObjectType + { + public XTagGraphType() : base() + { + Field(x => x.Tag); + Field(x => x.References); + } + } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXTagEvents.cs b/Interfaces/Entities/IXTagEvents.cs new file mode 100644 index 0000000..45af083 --- /dev/null +++ b/Interfaces/Entities/IXTagEvents.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xTagService.Models.Entities; + +namespace xTagService.Interfaces.Entities +{ + public interface IXTagEvents: IXBaseRepositoryEvents + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXTagGraphQLTypeHelper.cs b/Interfaces/Entities/IXTagGraphQLTypeHelper.cs new file mode 100644 index 0000000..b77e205 --- /dev/null +++ b/Interfaces/Entities/IXTagGraphQLTypeHelper.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xTagService.Models.Entities; + +namespace xTagService.Interfaces.Entities +{ + public interface IXTagGraphQLTypeHelper : IXBaseGraphQLTypeHelper + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXTagRepository.cs b/Interfaces/Entities/IXTagRepository.cs new file mode 100644 index 0000000..3ccfa32 --- /dev/null +++ b/Interfaces/Entities/IXTagRepository.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xTagService.Models.Entities; + +namespace xTagService.Interfaces.Entities +{ + public interface IXTagRepository : IXBaseRepository + { } +} \ No newline at end of file diff --git a/obj/Debug/netstandard2.0/xTagService.AssemblyInfo.cs b/obj/Debug/netstandard2.0/xTagService.AssemblyInfo.cs index d909f6a..4832403 100644 --- a/obj/Debug/netstandard2.0/xTagService.AssemblyInfo.cs +++ b/obj/Debug/netstandard2.0/xTagService.AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyDescriptionAttribute(("\r\n it is a Part of xDashboard on SaherElm IT Center which provides all Tag Rel" + "ated Futures ...\r\n "))] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3a8af391324d1ffdf0802d3f42236550168ebbe0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+620a11f3686a403712609908acf4fb33c309861a")] [assembly: System.Reflection.AssemblyProductAttribute("xTagService")] [assembly: System.Reflection.AssemblyTitleAttribute("xTagService")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]