diff --git a/Configurations/Entities/XFileEntityConfiguration.cs b/Configurations/Entities/XFileEntityConfiguration.cs index 55cde27..b225f29 100644 --- a/Configurations/Entities/XFileEntityConfiguration.cs +++ b/Configurations/Entities/XFileEntityConfiguration.cs @@ -2,6 +2,7 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using xDataService.Providers; +using xFileService.Constants; using xFileService.Models.Entities; namespace xFileService.Configurations.Entities @@ -10,7 +11,7 @@ namespace xFileService.Configurations.Entities { public override void Configure(EntityTypeBuilder builder) { - builder.ToTable("Files"); + builder.ToTable(XFileServiceConstants.XFileTable); } } } \ No newline at end of file diff --git a/Constants/XFileServiceConstants.cs b/Constants/XFileServiceConstants.cs new file mode 100644 index 0000000..2510d79 --- /dev/null +++ b/Constants/XFileServiceConstants.cs @@ -0,0 +1,33 @@ +using xFileService.Models.Entities; + +namespace xFileService.Constants +{ + public struct XFileServiceConstants + { + // + // Service Extensions Log Tag ... + public const string XFileServiceDILogTag = "XFileService"; + + // + // Table Mapping Identifiers ... + public const string XFileTable = "Files"; + + // + // GraphQL Collection Mappings ... + public const string XFileSingleName = "file"; + public const string XFileCollectionName = "files"; + + // + // Hubs ... + public const string XFileDtoHub = "fileDto"; + public const string XFileEntityHub = "fileEntity"; + + // + // Custome Constants ... + public const string XFileTagProvided = nameof(XFile); + + // + // EF Repositories Helper Extensions ... + public const string GetXFileEFRepositoryDescriptor = "GetXFileEFRepositoryDescriptor"; + } +} \ No newline at end of file diff --git a/DI/XDIHelperExtension.cs b/DI/XDIHelperExtension.cs index 0d21dd1..88ed841 100644 --- a/DI/XDIHelperExtension.cs +++ b/DI/XDIHelperExtension.cs @@ -17,6 +17,7 @@ using xFileService.Providers.Dtos; using xFileService.Providers.Entities; using xFileService.Interfaces; using xFileService.Providers; +using xFileService.Constants; namespace xFileService.DI { @@ -80,8 +81,8 @@ namespace xFileService.DI var pushHelper = new XPushServiceHelper(); // - pushHelper.AddHub("fileDto"); - pushHelper.AddHub("fileEntity"); + pushHelper.AddHub(XFileServiceConstants.XFileDtoHub); + pushHelper.AddHub(XFileServiceConstants.XFileEntityHub); // app.UseXPushService(pushHelper); @@ -106,7 +107,7 @@ namespace xFileService.DI /// /// a LogTag for Service ... /// - private static string XLogTag = "XFileService"; + private static string XLogTag = XFileServiceConstants.XFileServiceDILogTag; /// /// print a log in Console ... @@ -179,9 +180,9 @@ namespace xFileService.DI // descriptor = typeof(XFileServiceHelper) .InvokeGenericMethod( - methodName: "GetXFileEFRepositoryDescriptor", + args: null, runtimeType: contextType, - args: null + methodName: XFileServiceConstants.GetXFileEFRepositoryDescriptor ); break; diff --git a/Interfaces/IXFileSeeder.cs b/Interfaces/Entities/IXFileSeeder.cs similarity index 78% rename from Interfaces/IXFileSeeder.cs rename to Interfaces/Entities/IXFileSeeder.cs index 93d494a..c87716b 100644 --- a/Interfaces/IXFileSeeder.cs +++ b/Interfaces/Entities/IXFileSeeder.cs @@ -2,7 +2,7 @@ using System; using xDataService.Interfaces; using xFileService.Models.Entities; -namespace xFileService.Interfaces +namespace xFileService.Interfaces.Entities { public interface IXFileSeeder : IXBaseDbSeeder { } diff --git a/Providers/XFileSeederBase.cs b/Providers/Entities/XFileSeederBase.cs similarity index 90% rename from Providers/XFileSeederBase.cs rename to Providers/Entities/XFileSeederBase.cs index 5bbf589..e49c38e 100644 --- a/Providers/XFileSeederBase.cs +++ b/Providers/Entities/XFileSeederBase.cs @@ -1,11 +1,10 @@ using System; using xDataService.Configuration; using xDataService.Providers; -using xFileService.Interfaces; using xFileService.Interfaces.Entities; using xFileService.Models.Entities; -namespace xFileService.Providers +namespace xFileService.Providers.Entities { public abstract class XFileSeederBase : XBaseDbSeeder, IXFileSeeder { diff --git a/Providers/GraphQL/XFileGraphQLTypeHelper.cs b/Providers/GraphQL/XFileGraphQLTypeHelper.cs index 2454d2f..90625e2 100644 --- a/Providers/GraphQL/XFileGraphQLTypeHelper.cs +++ b/Providers/GraphQL/XFileGraphQLTypeHelper.cs @@ -1,6 +1,7 @@ using System; using xDataService.Configuration; using xDataService.GraphQL; +using xFileService.Constants; using xFileService.Interfaces.Entities; using xFileService.Models.Entities; @@ -15,12 +16,12 @@ namespace xFileService.Providers.GraphQL public override string GetInQueryCollectionName() { - return "files"; + return XFileServiceConstants.XFileCollectionName; } public override string GetInQuerySingleName() { - return "file"; + return XFileServiceConstants.XFileSingleName; } } } \ No newline at end of file diff --git a/Providers/XFileTagProvider.cs b/Providers/XFileTagProvider.cs index 12a9a50..4068b98 100644 --- a/Providers/XFileTagProvider.cs +++ b/Providers/XFileTagProvider.cs @@ -1,6 +1,6 @@ using System; +using xFileService.Constants; using xFileService.Interfaces; -using xFileService.Models.Entities; using xTagService.Interfaces.Dtos; using xTagService.Providers; @@ -11,8 +11,8 @@ namespace xFileService.Providers public XFileTagProvider( IXTagServiceProvider tagProvider ) : base( - providedFor: nameof(XFile), - tagProvider: tagProvider + tagProvider: tagProvider, + providedFor: XFileServiceConstants.XFileTagProvided ) { } }