refactor and add using constants instead of hard coded strings ...

This commit is contained in:
2026-07-30 14:27:17 +03:30
parent e37bad59ac
commit 335fd95d23
2 changed files with 12 additions and 7 deletions
+5
View File
@@ -32,5 +32,10 @@ namespace xCategoryService.Constants
public const string CategoryDescriptionResourceIdentifier = "CatD";
public const string SubCategoryTitleResourceIdentifier = "SubCatT";
public const string SubCategoryDescriptionResourceIdentifier = "SubCatD";
//
// EF Repositories Helper Extensions ...
public const string GetXCategoryEFRepositoryDescriptor = "GetXCategoryEFRepositoryDescriptor";
public const string GetXSubCategoryEFRepositoryDescriptor = "GetXSubCategoryEFRepositoryDescriptor";
}
}
+6 -6
View File
@@ -205,8 +205,8 @@ namespace xCategoryService.DI
//
// Count Data in Category ...
var hasCategory = (categoryProvider.Count().GetAwaiter().GetResult()) > 0;
var hasSubCategory = (subCategoryProvider.Count().GetAwaiter().GetResult()) > 0;
var hasCategory = categoryProvider.Count().GetAwaiter().GetResult() > 0;
var hasSubCategory = subCategoryProvider.Count().GetAwaiter().GetResult() > 0;
//
// Seed Category Resources ...
@@ -370,18 +370,18 @@ namespace xCategoryService.DI
// Category ...
categoryDescriptor = typeof(XCategoryServiceHelper)
.InvokeGenericMethod<XRepositoryDescriptor>(
methodName: "GetXCategoryEFRepositoryDescriptor",
args: null,
runtimeType: contextType,
args: null
methodName: XCategoryServiceConstants.GetXCategoryEFRepositoryDescriptor
);
//
// SubCategory ...
subCategoryDescriptor = typeof(XCategoryServiceHelper)
.InvokeGenericMethod<XRepositoryDescriptor>(
methodName: "GetXSubCategoryEFRepositoryDescriptor",
args: null,
runtimeType: contextType,
args: null
methodName: XCategoryServiceConstants.GetXSubCategoryEFRepositoryDescriptor
);
break;