diff --git a/Configurations/Entities/XWebinarEntityConfiguration.cs b/Configurations/Entities/XWebinarEntityConfiguration.cs index 18c9a63..93806bc 100644 --- a/Configurations/Entities/XWebinarEntityConfiguration.cs +++ b/Configurations/Entities/XWebinarEntityConfiguration.cs @@ -2,6 +2,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using xDataService.Providers; +using xWebinarService.Constants; using xWebinarService.Models.Entities; namespace xWebinarService.Configurations.Entities @@ -10,7 +11,7 @@ namespace xWebinarService.Configurations.Entities { public override void Configure(EntityTypeBuilder builder) { - builder.ToTable("Webinars"); + builder.ToTable(XWebinarServiceConstants.XWebinarTable); } } } \ No newline at end of file diff --git a/Configurations/Entities/XWebinarSubscriberEntityConfiguration.cs b/Configurations/Entities/XWebinarSubscriberEntityConfiguration.cs index 3d0496f..7282f33 100644 --- a/Configurations/Entities/XWebinarSubscriberEntityConfiguration.cs +++ b/Configurations/Entities/XWebinarSubscriberEntityConfiguration.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using xDataService.Providers; +using xWebinarService.Constants; using xWebinarService.Models.Entities; namespace xWebinarService.Configurations.Entities @@ -9,7 +10,7 @@ namespace xWebinarService.Configurations.Entities { public override void Configure(EntityTypeBuilder builder) { - builder.ToTable("WebinarSubscribers"); + builder.ToTable(XWebinarServiceConstants.XWebinarSubscriberTable); } } } \ No newline at end of file diff --git a/Constants/XWebinarServiceConstants.cs b/Constants/XWebinarServiceConstants.cs new file mode 100644 index 0000000..1fc5845 --- /dev/null +++ b/Constants/XWebinarServiceConstants.cs @@ -0,0 +1,37 @@ +namespace xWebinarService.Constants +{ + public struct XWebinarServiceConstants + { + // + // Service Extensions Log Tag ... + public const string XWebinarServiceDILogTag = "XWebinarService"; + + // + // Table Mapping Identifiers ... + public const string XWebinarTable = "Webinars"; + public const string XWebinarSubscriberTable = "WebinarSubscribers"; + + // + // GraphQL Collection Mappings ... + public const string XWebinarSingleName = "webinar"; + public const string XWebinarCollectionName = "webinars"; + + public const string XWebinarSubscriberSingleName = "webinarSubscriber"; + public const string XWebinarSubscriberCollectionName = "webinarSubscribers"; + + // + // Hubs ... + public const string XWebinarDtoHub = "webinarDto"; + public const string XWebinarEntityHub = "webinarEntity"; + public const string XWebinarSubscriberDtoHub = "webinarSubscriberDto"; + public const string XWebinarSubscriberEntityHub = "webinarSubscriberEntity"; + + // + // Custome Constants ... + + // + // EF Repositories Helper Extensions ... + public const string GetXWebinarEFRepositoryDescriptor = "GetXWebinarEFRepositoryDescriptor"; + public const string GetXWebinarSubscriberEFRepositoryDescriptor = "GetXWebinarSubscriberEFRepositoryDescriptor"; + } +} \ No newline at end of file diff --git a/DI/XDIHelperExtension.cs b/DI/XDIHelperExtension.cs index 7360012..8f3ccc5 100644 --- a/DI/XDIHelperExtension.cs +++ b/DI/XDIHelperExtension.cs @@ -10,6 +10,7 @@ using xDataService.Models; using xExceptions.Constants; using xPushService.DI; using xPushService.Helpers; +using xWebinarService.Constants; using xWebinarService.Helpers; using xWebinarService.Interfaces.Dtos; using xWebinarService.Interfaces.Entities; @@ -78,12 +79,12 @@ namespace xWebinarService.DI var pushHelper = new XPushServiceHelper(); // - pushHelper.AddHub("webinarDto"); - pushHelper.AddHub("webinarEntity"); + pushHelper.AddHub(XWebinarServiceConstants.XWebinarDtoHub); + pushHelper.AddHub(XWebinarServiceConstants.XWebinarEntityHub); // - pushHelper.AddHub("webinarSubscriberDto"); - pushHelper.AddHub("webinarSubscriberEntity"); + pushHelper.AddHub(XWebinarServiceConstants.XWebinarSubscriberDtoHub); + pushHelper.AddHub(XWebinarServiceConstants.XWebinarSubscriberEntityHub); // app.UseXPushService(pushHelper); @@ -120,7 +121,7 @@ namespace xWebinarService.DI /// /// a LogTag for Service ... /// - private static string XLogTag = "XWebinarService"; + private static string XLogTag = XWebinarServiceConstants.XWebinarServiceDILogTag; /// /// print a log in Console ... @@ -193,17 +194,17 @@ namespace xWebinarService.DI // webinarDescriptor = typeof(XWebinarServiceHelper) .InvokeGenericMethod( - methodName: "GetXWebinarEFRepositoryDescriptor", + args: null, runtimeType: contextType, - args: null + methodName: XWebinarServiceConstants.GetXWebinarEFRepositoryDescriptor ); // webinarSubscriberDescriptor = typeof(XWebinarServiceHelper) .InvokeGenericMethod( - methodName: "GetXWebinarSubscriberEFRepositoryDescriptor", + args: null, runtimeType: contextType, - args: null + methodName: XWebinarServiceConstants.GetXWebinarSubscriberEFRepositoryDescriptor ); break; diff --git a/Interfaces/IXWebinarSeeder.cs b/Interfaces/Entities/IXWebinarSeeder.cs similarity index 78% rename from Interfaces/IXWebinarSeeder.cs rename to Interfaces/Entities/IXWebinarSeeder.cs index a60320e..084c500 100644 --- a/Interfaces/IXWebinarSeeder.cs +++ b/Interfaces/Entities/IXWebinarSeeder.cs @@ -2,7 +2,7 @@ using System; using xDataService.Interfaces; using xWebinarService.Models.Entities; -namespace xWebinarService.Interfaces +namespace xWebinarService.Interfaces.Entities { public interface IXWebinarSeeder : IXBaseDbSeeder { } diff --git a/Interfaces/IXWebinarSubscriberSeeder.cs b/Interfaces/Entities/IXWebinarSubscriberSeeder.cs similarity index 78% rename from Interfaces/IXWebinarSubscriberSeeder.cs rename to Interfaces/Entities/IXWebinarSubscriberSeeder.cs index 12387e1..1faaa54 100644 --- a/Interfaces/IXWebinarSubscriberSeeder.cs +++ b/Interfaces/Entities/IXWebinarSubscriberSeeder.cs @@ -1,7 +1,7 @@ using xDataService.Interfaces; using xWebinarService.Models.Entities; -namespace xWebinarService.Interfaces +namespace xWebinarService.Interfaces.Entities { public interface IXWebinarSubscriberSeeder : IXBaseDbSeeder { } diff --git a/Providers/XWebinarSeederBase.cs b/Providers/Entities/XWebinarSeederBase.cs similarity index 89% rename from Providers/XWebinarSeederBase.cs rename to Providers/Entities/XWebinarSeederBase.cs index 6625000..5ac2369 100644 --- a/Providers/XWebinarSeederBase.cs +++ b/Providers/Entities/XWebinarSeederBase.cs @@ -1,11 +1,10 @@ using System; using xDataService.Configuration; using xDataService.Providers; -using xWebinarService.Interfaces; using xWebinarService.Interfaces.Entities; using xWebinarService.Models.Entities; -namespace xWebinarService.Providers +namespace xWebinarService.Providers.Entities { public abstract class XWebinarSeederBase : XBaseDbSeeder, IXWebinarSeeder { diff --git a/Providers/XWebinarSubscriberSeederBase.cs b/Providers/Entities/XWebinarSubscriberSeederBase.cs similarity index 88% rename from Providers/XWebinarSubscriberSeederBase.cs rename to Providers/Entities/XWebinarSubscriberSeederBase.cs index f4104c4..4da454e 100644 --- a/Providers/XWebinarSubscriberSeederBase.cs +++ b/Providers/Entities/XWebinarSubscriberSeederBase.cs @@ -1,11 +1,9 @@ -using System; using xDataService.Configuration; using xDataService.Providers; -using xWebinarService.Interfaces; using xWebinarService.Interfaces.Entities; using xWebinarService.Models.Entities; -namespace xWebinarService.Providers +namespace xWebinarService.Providers.Entities { public abstract class XWebinarSubscriberSeederBase : XBaseDbSeeder, IXWebinarSubscriberSeeder { diff --git a/Providers/GraphQL/XWebinarGraphQLTypeHelper.cs b/Providers/GraphQL/XWebinarGraphQLTypeHelper.cs index 09bf6ed..f29fd47 100644 --- a/Providers/GraphQL/XWebinarGraphQLTypeHelper.cs +++ b/Providers/GraphQL/XWebinarGraphQLTypeHelper.cs @@ -1,6 +1,7 @@ using System; using xDataService.Configuration; using xDataService.GraphQL; +using xWebinarService.Constants; using xWebinarService.Interfaces.Entities; using xWebinarService.Models.Entities; @@ -15,12 +16,12 @@ namespace xWebinarService.Providers.GraphQL public override string GetInQueryCollectionName() { - return "webinars"; + return XWebinarServiceConstants.XWebinarCollectionName; } public override string GetInQuerySingleName() { - return "webinar"; + return XWebinarServiceConstants.XWebinarSingleName; } } } \ No newline at end of file diff --git a/Providers/GraphQL/XWebinarSubscriberGraphQLTypeHelper.cs b/Providers/GraphQL/XWebinarSubscriberGraphQLTypeHelper.cs index 92c35ba..7a7607e 100644 --- a/Providers/GraphQL/XWebinarSubscriberGraphQLTypeHelper.cs +++ b/Providers/GraphQL/XWebinarSubscriberGraphQLTypeHelper.cs @@ -1,6 +1,7 @@ using System; using xDataService.Configuration; using xDataService.GraphQL; +using xWebinarService.Constants; using xWebinarService.Interfaces.Entities; using xWebinarService.Models.Entities; @@ -15,12 +16,12 @@ namespace xWebinarService.Providers.GraphQL public override string GetInQueryCollectionName() { - return "webinarSubscribers"; + return XWebinarServiceConstants.XWebinarSubscriberCollectionName; } public override string GetInQuerySingleName() { - return "webinarSubscriber"; + return XWebinarServiceConstants.XWebinarSubscriberSingleName; } } } \ No newline at end of file