Class FieldOptionService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public class FieldOptionService : ICacheStorage<string, FieldOption>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
Field
Option Service
- Implements
- Inherited Members
Constructors
FieldOptionService()
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
Parameters
keys
IEnumerable<string>Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
Parameters
key
stringKey to reset
ClearCacheByFieldId(string)
Parameters
fieldId
string
Copy(FieldOption)
Retrieves shallow copy of the current object.
Parameters
option
FieldOption
Returns
- Field
Option Shallow copy of the current object.
Delete(string)
Deletes specified option.
Parameters
optionId
stringAn ID of the option to delete.
DeleteAll(string)
Deletes all options that belongs to specified field.
Parameters
fieldId
stringAn ID of either a product field or a product group field.
DeleteByIds(IEnumerable<string>, string)
Parameters
ids
IEnumerable<string>languageId
string
DeleteExcessOptionTranslations()
DeleteFieldOptionTranslations(string)
Parameters
fieldId
string
DeleteFieldOptionTranslations(string, string)
Parameters
DeleteTranslation(int)
Parameters
id
int
GetOptionById(string)
Retrieves an option from by its ID.
Parameters
optionId
stringAn ID of the option.
Returns
- Field
Option Option instance or null (Nothing in Visual Basic) if the specified option can not be found.
GetOptionsByFieldId(string)
Retrieves a collection of options that matches specified field ID.
Parameters
fieldId
stringAn ID of the field.
Returns
- Field
Option Collection A collection of options that matches specified field ID.
Remarks
The resulting collection is sorted ascending by the sort number.
GetOptionsByFieldIdAndValues(string, HashSet<string>)
Retrieves a collection of options that matches specified field ID.
public FieldOptionCollection GetOptionsByFieldIdAndValues(string fieldId, HashSet<string> optionValues)
Parameters
Returns
- Field
Option Collection A collection of options that matches specified field ID.
Remarks
The resulting collection is sorted ascending by the sort number.
GetOptionsByFieldIds(IEnumerable<string>)
public static IDictionary<string, FieldOptionCollection> GetOptionsByFieldIds(IEnumerable<string> fieldIds)
Parameters
fieldIds
IEnumerable<string>
Returns
MaximumSort(string)
Retrieves the maximum sort number for options that matches specified field ID.
Parameters
fieldId
stringAn ID of the field.
Returns
- int
The maximum sort number for options that matches specified field ID.
MinimumSort(string)
Retrieves the minimum sort number for options that matches specified field ID.
Parameters
fieldId
stringAn ID of the field.
Returns
- int
The minimum sort number for options that matches specified field ID.
Save(FieldOption)
Saves an option.
Parameters
option
FieldOption
SaveOptions(IEnumerable<FieldOption>)
Parameters
options
IEnumerable<FieldOption >
SaveTranslation(FieldOptionTranslation)
Parameters
fieldOptionTranslation
FieldOption Translation