Class ProductFieldValueCollection
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a collection of ProductFieldValue objects.
[Serializable]
public class ProductFieldValueCollection : KeyedCollection<string, ProductFieldValue>, IList<ProductFieldValue>, ICollection<ProductFieldValue>, IReadOnlyList<ProductFieldValue>, IReadOnlyCollection<ProductFieldValue>, IEnumerable<ProductFieldValue>, IList, ICollection, IEnumerable
- Inheritance
-
ProductFieldValueCollection
- Implements
- Inherited Members
- Extension Methods
Examples
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductGroupCustomFieldsRendererSample
{
public void RenderProductGroupCustomFields(ProductGroupFieldValueCollection productGroupFieldValues)
{
var values = new ProductFieldValueCollection();
foreach (var 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
ProductFieldValueCollection()
Initializes a new instance of the ProductFieldValueCollection class.
public ProductFieldValueCollection()
ProductFieldValueCollection(IDataReader)
Initializes a new instance of the ProductFieldValueCollection class.
public ProductFieldValueCollection(IDataReader dataReader)
Parameters
dataReader
IDataReader- DataReader.
ProductFieldValueCollection(string, IDataReader)
Initializes a new instance of the ProductFieldValueCollection class.
public ProductFieldValueCollection(string languageId, IDataReader dataReader)
Parameters
languageId
string- The Language ID.
dataReader
IDataReader- The DataReader.
ProductFieldValueCollection(string, IDataReader, bool)
Initializes a new instance of the ProductFieldValueCollection class.
public ProductFieldValueCollection(string languageId, IDataReader dataReader, bool checkIfColumnExists)
Parameters
languageId
string- The Language ID.
dataReader
IDataReader- The DataReader.
checkIfColumnExists
bool- If true check that product field columns exists in reader and add field value
Methods
Add(ProductFieldValue)
public void Add(ProductFieldValue item)
Parameters
item
ProductFieldValue
GetKeyForItem(ProductFieldValue)
protected override string GetKeyForItem(ProductFieldValue item)
Parameters
item
ProductFieldValue
Returns
GetProductFieldValue(string)
Gets the ProductFieldValue object.
public ProductFieldValue GetProductFieldValue(string systemName)
Parameters
systemName
string- System name.
Returns
RefreshProviderFields(Product)
public void RefreshProviderFields(Product product)
Parameters
product
Product
Save(DataRow)
Saves the specified DataRow.
public void Save(DataRow dataRow)
Parameters
dataRow
DataRow- DataRow.