Class ProductGroupFieldValueCollection
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents collection of ProductGroupFieldValue objects.
[Serializable]
public class ProductGroupFieldValueCollection : Collection<ProductGroupFieldValue>, IList<ProductGroupFieldValue>, ICollection<ProductGroupFieldValue>, IReadOnlyList<ProductGroupFieldValue>, IReadOnlyCollection<ProductGroupFieldValue>, IEnumerable<ProductGroupFieldValue>, IList, ICollection, IEnumerable
- Inheritance
-
ProductGroupFieldValueCollection
- Implements
- Inherited Members
- Extension Methods
Examples
using System;
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products;
public static class ProductGroupCustomFieldsRendererSample
{
public static void RenderProductGroupCustomFields(ProductGroupFieldValueCollection productGroupFieldValues)
{
ArgumentNullException.ThrowIfNull(productGroupFieldValues);
var values = new ProductFieldValueCollection();
foreach (ProductGroupFieldValue value in productGroupFieldValues)
{
var field = new ProductField();
var fieldValue = new ProductFieldValue(field, value.Value)
{
ProductField =
{
Types = value.ProductGroupField.Types,
TemplateName = value.ProductGroupField.TemplateName,
SystemName = value.ProductGroupField.SystemName
},
Value = value.Value
};
values.Add(fieldValue);
}
if (values.Count > 0)
{
//TODO: insert your code here
}
}
}
Constructors
ProductGroupFieldValueCollection()
Initializes a new instance of the ProductGroupFieldValueCollection class.
public ProductGroupFieldValueCollection()
ProductGroupFieldValueCollection(IDataReader)
Initializes a new instance of the ProductGroupFieldValueCollection class.
public ProductGroupFieldValueCollection(IDataReader dataReader)
Parameters
dataReaderIDataReaderDataReader.
Methods
GetProductGroupFieldValue(string)
Gets the ProductGroupFieldValue.
public ProductGroupFieldValue GetProductGroupFieldValue(string systemName)
Parameters
systemNamestringSystem name.
Returns
Save(DataRow)
Saves the specified data row.
public void Save(DataRow dataRow)
Parameters
dataRowDataRowDataRow.