diff --git a/Configurations/Entities/XStringEntityConfiguration.cs b/Configurations/Entities/XStringEntityConfiguration.cs index b02c17e..b5bfb28 100644 --- a/Configurations/Entities/XStringEntityConfiguration.cs +++ b/Configurations/Entities/XStringEntityConfiguration.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using xDataService.Providers; +using xStringService.Constants; using xStringService.Models.Entities; namespace xStringService.Configurations.Entities @@ -9,7 +10,7 @@ namespace xStringService.Configurations.Entities { public override void Configure(EntityTypeBuilder builder) { - builder.ToTable("Strings"); + builder.ToTable(XStringServiceConstants.XStringTable); } } } \ No newline at end of file diff --git a/Constants/.gitkeep b/Constants/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Constants/XStringServiceConstants.cs b/Constants/XStringServiceConstants.cs new file mode 100644 index 0000000..2f2ded2 --- /dev/null +++ b/Constants/XStringServiceConstants.cs @@ -0,0 +1,30 @@ +namespace xStringService.Constants +{ + public struct XStringServiceConstants + { + // + // Service Extensions Log Tag ... + public const string XStringServiceDILogTag = "XStringService"; + + // + // Table Mapping Identifiers ... + public const string XStringTable = "Strings"; + + // + // GraphQL Collection Mappings ... + public const string XStringSingleName = "string"; + public const string XStringCollectionName = "strings"; + + // + // Hubs ... + public const string XStringDtoHub = "stringDto"; + public const string XStringEntityHub = "stringEntity"; + + // + // Custome Constants ... + + // + // EF Repositories Helper Extensions ... + public const string GetXStringEFRepositoryDescriptor = "GetXStringEFRepositoryDescriptor"; + } +} \ No newline at end of file diff --git a/DI/XDIHelperExtension.cs b/DI/XDIHelperExtension.cs index 589dd9c..ea96146 100644 --- a/DI/XDIHelperExtension.cs +++ b/DI/XDIHelperExtension.cs @@ -17,6 +17,7 @@ using xPushService.Helpers; using xPushService.DI; using xStringService.Interfaces; using xStringService.Providers; +using xStringService.Constants; namespace xStringService.DI { @@ -80,8 +81,8 @@ namespace xStringService.DI var pushHelper = new XPushServiceHelper(); // - pushHelper.AddHub("stringDto"); - pushHelper.AddHub("stringEntity"); + pushHelper.AddHub(XStringServiceConstants.XStringDtoHub); + pushHelper.AddHub(XStringServiceConstants.XStringEntityHub); // app.UseXPushService(pushHelper); @@ -106,7 +107,7 @@ namespace xStringService.DI /// /// a LogTag for Service ... /// - private static string XLogTag = "XStringService"; + private static string XLogTag = XStringServiceConstants.XStringServiceDILogTag; /// /// print a log in Console ... @@ -179,9 +180,9 @@ namespace xStringService.DI // descriptor = typeof(XStringServiceHelper) .InvokeGenericMethod( - methodName: "GetXStringEFRepositoryDescriptor", + args: null, runtimeType: contextType, - args: null + methodName: XStringServiceConstants.GetXStringEFRepositoryDescriptor ); break; diff --git a/Interfaces/IXStringSeeder.cs b/Interfaces/Entities/IXStringSeeder.cs similarity index 76% rename from Interfaces/IXStringSeeder.cs rename to Interfaces/Entities/IXStringSeeder.cs index 56c5915..a9a889a 100644 --- a/Interfaces/IXStringSeeder.cs +++ b/Interfaces/Entities/IXStringSeeder.cs @@ -1,7 +1,7 @@ using xDataService.Interfaces; using xStringService.Models.Entities; -namespace xStringService.Interfaces +namespace xStringService.Interfaces.Entities { public interface IXStringSeeder : IXBaseDbSeeder {} diff --git a/Providers/XStringSeederBase.cs b/Providers/Entities/XStringSeederBase.cs similarity index 89% rename from Providers/XStringSeederBase.cs rename to Providers/Entities/XStringSeederBase.cs index a79cb4d..c2e2182 100644 --- a/Providers/XStringSeederBase.cs +++ b/Providers/Entities/XStringSeederBase.cs @@ -1,10 +1,9 @@ using xDataService.Configuration; using xDataService.Providers; -using xStringService.Interfaces; using xStringService.Interfaces.Entities; using xStringService.Models.Entities; -namespace xStringService.Providers +namespace xStringService.Providers.Entities { public abstract class XStringSeederBase : XBaseDbSeeder, IXStringSeeder { diff --git a/Providers/GraphQL/XStringGraphQLTypeHelper.cs b/Providers/GraphQL/XStringGraphQLTypeHelper.cs index bb1e819..ae05da3 100644 --- a/Providers/GraphQL/XStringGraphQLTypeHelper.cs +++ b/Providers/GraphQL/XStringGraphQLTypeHelper.cs @@ -1,5 +1,6 @@ using xDataService.Configuration; using xDataService.GraphQL; +using xStringService.Constants; using xStringService.Interfaces.Entities; using xStringService.Models.Entities; @@ -14,12 +15,12 @@ namespace xStringService.Providers.GraphQL public override string GetInQueryCollectionName() { - return "strings"; + return XStringServiceConstants.XStringCollectionName; } public override string GetInQuerySingleName() { - return "string"; + return XStringServiceConstants.XStringSingleName; } } } \ No newline at end of file