问题描述
以下两个代码片段之间有什么区别(如果有的话),一个使用CatalogContext.GetCategory,另一个使用ProductCatalog.GetCategory?
类别cat = CatalogContext.GetCategory(" MyCatalogName"," MyCategoryName");
产品目录prodCatalog = CatalogContext.GetCatalog(" MyCatalogName");
类别cat = ProductCatalog.GetCategory(" MyCategoryName");
有什么理由使用一种方法而不是另一种方法?为什么有两个不同的类使用GetCategory方法?
What difference, if any, is there between the following two code snippets, one using CatalogContext.GetCategory and the other using ProductCatalog.GetCategory?
Category cat = CatalogContext.GetCategory("MyCatalogName", "MyCategoryName");
ProductCatalog prodCatalog = CatalogContext.GetCatalog("MyCatalogName");
Category cat = ProductCatalog.GetCategory("MyCategoryName");
Is there any reason to use one approach over the other? Why are there two different classes with a GetCategory method?
推荐答案
这篇关于CatalogContext.GetCategory和ProductCatalog.GetCategory之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!