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 XCategoryEntityHub = "categoryEntity";
|
||||||
public const string XSubCategoryDtoHub = "subCategoryDto";
|
public const string XSubCategoryDtoHub = "subCategoryDto";
|
||||||
public const string XSubCategoryEntityHub = "subCategoryEntity";
|
public const string XSubCategoryEntityHub = "subCategoryEntity";
|
||||||
|
|
||||||
//
|
//
|
||||||
// Custome Constants ...
|
// Custome Constants ...
|
||||||
public const string SubCategoryReference = "SubCat";
|
public const string SubCategoryReference = "SubCat";
|
||||||
@@ -32,5 +32,10 @@ namespace xCategoryService.Constants
|
|||||||
public const string CategoryDescriptionResourceIdentifier = "CatD";
|
public const string CategoryDescriptionResourceIdentifier = "CatD";
|
||||||
public const string SubCategoryTitleResourceIdentifier = "SubCatT";
|
public const string SubCategoryTitleResourceIdentifier = "SubCatT";
|
||||||
public const string SubCategoryDescriptionResourceIdentifier = "SubCatD";
|
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 ...
|
// Count Data in Category ...
|
||||||
var hasCategory = (categoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
var hasCategory = categoryProvider.Count().GetAwaiter().GetResult() > 0;
|
||||||
var hasSubCategory = (subCategoryProvider.Count().GetAwaiter().GetResult()) > 0;
|
var hasSubCategory = subCategoryProvider.Count().GetAwaiter().GetResult() > 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Seed Category Resources ...
|
// Seed Category Resources ...
|
||||||
@@ -370,18 +370,18 @@ namespace xCategoryService.DI
|
|||||||
// Category ...
|
// Category ...
|
||||||
categoryDescriptor = typeof(XCategoryServiceHelper)
|
categoryDescriptor = typeof(XCategoryServiceHelper)
|
||||||
.InvokeGenericMethod<XRepositoryDescriptor>(
|
.InvokeGenericMethod<XRepositoryDescriptor>(
|
||||||
methodName: "GetXCategoryEFRepositoryDescriptor",
|
args: null,
|
||||||
runtimeType: contextType,
|
runtimeType: contextType,
|
||||||
args: null
|
methodName: XCategoryServiceConstants.GetXCategoryEFRepositoryDescriptor
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SubCategory ...
|
// SubCategory ...
|
||||||
subCategoryDescriptor = typeof(XCategoryServiceHelper)
|
subCategoryDescriptor = typeof(XCategoryServiceHelper)
|
||||||
.InvokeGenericMethod<XRepositoryDescriptor>(
|
.InvokeGenericMethod<XRepositoryDescriptor>(
|
||||||
methodName: "GetXSubCategoryEFRepositoryDescriptor",
|
args: null,
|
||||||
runtimeType: contextType,
|
runtimeType: contextType,
|
||||||
args: null
|
methodName: XCategoryServiceConstants.GetXSubCategoryEFRepositoryDescriptor
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user