Class ProductFieldValue
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
This class saves the new values for ProductField
[Serializable]
public class ProductFieldValue
- Inheritance
-
ProductFieldValue
- Inherited Members
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
ProductFieldValue()
Initializes a new instance of the ProductFieldValue class.
public ProductFieldValue()
ProductFieldValue(ProductField, object?)
Initializes a new instance of the ProductFieldValue class.
[SetsRequiredMembers]
public ProductFieldValue(ProductField productField, object? value)
Parameters
productFieldProductFieldThe product field.
valueobjectThe value.
ProductFieldValue(string, ProductField, object?)
Initializes a new instance of the ProductFieldValue class.
[SetsRequiredMembers]
public ProductFieldValue(string languageId, ProductField productField, object? value)
Parameters
languageIdstringLanguage ID.
productFieldProductFieldThe product field.
valueobjectThe value.
Properties
HasValue
Gets value indicating whether the product field value has been set.
[MemberNotNullWhen(true, "Value")]
public bool HasValue { get; }
Property Value
LanguageId
Gets the language id.
public string LanguageId { get; }
Property Value
ProductField
Gets or sets the product field.
public required ProductField ProductField { get; set; }
Property Value
- ProductField
The product field.
Value
Gets or sets the value.
public object? Value { get; set; }
Property Value
- object
The value.
Methods
GetFieldName()
Get product field name
public string GetFieldName()
Returns
Save(DataRow)
Saves the specified DataRow.
public void Save(DataRow dataRow)
Parameters
dataRowDataRowDataRow.