private static ProductManufacturerCollection DBMapping(DBProductManufacturerCollection dbCollection) { if (dbCollection == null) { return(null); } ProductManufacturerCollection collection = new ProductManufacturerCollection(); foreach (DBProductManufacturer dbItem in dbCollection) { ProductManufacturer item = DBMapping(dbItem); collection.Add(item); } return(collection); }
/// <summary> /// Gets a product manufacturer mapping collection /// </summary> /// <param name="ProductID">Product identifier</param> /// <returns>Product manufacturer mapping collection</returns> public static ProductManufacturerCollection GetProductManufacturersByProductID(int ProductID) { bool showHidden = NopContext.Current.IsAdmin; string key = string.Format(PRODUCTMANUFACTURERS_ALLBYPRODUCTID_KEY, showHidden, ProductID); object obj2 = NopCache.Get(key); if (ManufacturerManager.MappingsCacheEnabled && (obj2 != null)) { return((ProductManufacturerCollection)obj2); } DBProductManufacturerCollection dbCollection = DBProviderManager <DBManufacturerProvider> .Provider.GetProductManufacturersByProductID(ProductID, showHidden); ProductManufacturerCollection productManufacturerCollection = DBMapping(dbCollection); if (ManufacturerManager.MappingsCacheEnabled) { NopCache.Max(key, productManufacturerCollection); } return(productManufacturerCollection); }