Class FieldTypeService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public class FieldTypeService : ICacheStorage<int, FieldType>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
FieldTypeService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(int key)
Parameters
keyintKey to reset
Delete(int)
Delete the field type from the database
public virtual void Delete(int id)
Parameters
idintThe id of the field type, which should be deleted
Exceptions
- ArgumentOutOfRangeException
Thrown when
idis negative or zero
GetById(int)
Gets the field type by id
public virtual FieldType? GetById(int id)
Parameters
idintThe id of the field type
Returns
- FieldType
The FieldType object
GetByName(string)
public virtual FieldType? GetByName(string typeName)
Parameters
typeNamestring
Returns
GetFieldTypes(bool)
Load custom field types
public virtual IEnumerable<FieldType> GetFieldTypes(bool showAdvanced)
Parameters
showAdvancedboolInclude or not advanced types
Returns
- IEnumerable<FieldType>
Collection of FieldType objects
GetTypeName(FieldType)
Gives the english names of the field type for the standard ones and returns the non-translated name for all non-standard field types
public static string? GetTypeName(FieldType fieldType)
Parameters
fieldTypeFieldTypeThe field type with the name which will be mapped
Returns
- string
The english name of the field type if the field type is standard, otherwise it will just return the name of the field type
IsUsed(int)
Checks if the current field type is used in either OrderField, ProductField, GroupField or ProductCategoryField
public virtual bool IsUsed(int id)
Parameters
idintThe id of the field type to check if used
Returns
- bool
true if the field type is used on a field otherwise false
Save(FieldType)
Saves the field type object in the database
public virtual int Save(FieldType fieldType)
Parameters
fieldTypeFieldTypeThe field type object to be saved
Returns
- int
The identity of the database row which was inserted
Exceptions
- ArgumentNullException
Thrown when
fieldTypeis null
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, FieldType>
Type Parameters
TObjectCache