internal static string NodeTypeAlias(this IProductInternalExternalShared product) { if (product == null) { return(Product.NodeAlias); } if (!string.IsNullOrEmpty(product.TypeAlias)) { return(product.TypeAlias); } // should never come beyond this line var p = product as Product; if (p != null && p.NodeTypeAlias != null) { return(p.NodeTypeAlias); } var entity = IO.Container.Resolve <ICMSEntityRepository>().GetByGlobalId(product.Id); if (entity != null && entity.NodeTypeAlias != null) { return(entity.NodeTypeAlias); } return(Product.NodeAlias); }
// todo: use TypeAlias instead of this internal static string NodeTypeAlias(this IProductInternalExternalShared product) { var p = product as Product; if (p != null && p.NodeTypeAlias != null) { return(p.NodeTypeAlias); } if (product == null) { return(Product.NodeAlias); } var entity = IO.Container.Resolve <ICMSEntityRepository>().GetByGlobalId(product.Id); if (entity != null && entity.NodeTypeAlias != null) { return(entity.NodeTypeAlias); } return(Product.NodeAlias); }