refactor and add using constants instead of hard coded strings ...
This commit is contained in:
@@ -24,7 +24,7 @@ namespace xCategoryService.Constants
|
||||
public const string XCategoryEntityHub = "categoryEntity";
|
||||
public const string XSubCategoryDtoHub = "subCategoryDto";
|
||||
public const string XSubCategoryEntityHub = "subCategoryEntity";
|
||||
|
||||
|
||||
//
|
||||
// Custome Constants ...
|
||||
public const string SubCategoryReference = "SubCat";
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user