Class FieldOption
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a single field option.
[Serializable]
public class FieldOption
- Inheritance
-
FieldOption
- Inherited Members
Examples
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductFieldOptionHandlerSample
{
public string AddOption(string fieldId, string name, string value)
{
FieldOption option = new FieldOption
{
FieldId = fieldId,
Sort = Services.FieldOptions.MaximumSort(fieldId) + 1,
Value = value,
IsDefault = false
};
var languageId = Services.Languages.GetDefaultLanguageId();
option.SetName(languageId, name);
Services.FieldOptions.Save(option);
return option.Id;
}
}
}
Constructors
FieldOption()
Initializes a new instance of FieldOption.
public FieldOption()
FieldOption(FieldOption)
Initializes a new instance of FieldOption.
public FieldOption(FieldOption option)
Parameters
option
FieldOptionOption to copy property values from.
Properties
FieldId
Gets or sets and ID of the related field.
public string FieldId { get; set; }
Property Value
Id
Gets or sets option ID.
public string Id { get; set; }
Property Value
IsDefault
Gets or sets value indicating whether this option is selected by default.
public bool IsDefault { get; set; }
Property Value
Sort
Gets or sets the sort number.
public int Sort { get; set; }
Property Value
Translations
Gets the translations for the current entity
public TranslationCollection<FieldOptionTranslation> Translations { get; }
Property Value
Value
Gets or sets the value associated with this option.
public string Value { get; set; }
Property Value
Methods
GetName(string)
public string GetName(string languageId)
Parameters
languageId
string
Returns
SetName(string, string)
public void SetName(string languageId, string name)