Class StockLocation
- Namespace
- Dynamicweb.Ecommerce.Stocks
- Assembly
- Dynamicweb.Ecommerce.dll
Represents the stock location.
[Serializable]
public class StockLocation
- Inheritance
-
StockLocation
- Inherited Members
Properties
CategoryId
public string? CategoryId { get; set; }
Property Value
ExternalId
public string? ExternalId { get; set; }
Property Value
ID
public long ID { get; set; }
Property Value
SortOrder
public int SortOrder { get; set; }
Property Value
Translations
Gets the translations collection for this stock location.
public TranslationCollection<StockLocationTranslation> Translations { get; }
Property Value
Remarks
The collection is lazily populated with StockLocationTranslation instances keyed by language id. Use SetName(string, string), SetDescription(string, string) or Set(T) to add or update translations.
UserId
public int UserId { get; set; }
Property Value
Methods
Clone()
Creates a shallow copy of the current StockLocation and performs a deep copy of the Translations collection. The returned instance will have its own TranslationCollection<T> with cloned StockLocationTranslation entries so that modifying translations on the clone does not affect the original instance.
public StockLocation Clone()
Returns
- StockLocation
A new StockLocation instance with copied scalar properties and cloned translations.
GetDescription(string)
Returns the translated Description for the specified languageId.
Falls back to the default language when the requested translation is not available and returns an empty string
when no translation exists.
public string GetDescription(string languageId)
Parameters
languageIdstringLanguage identifier.
Returns
- string
The translated description or an empty string.
GetName(string)
Returns the translated Name for the specified languageId.
If the translation for languageId is not present the method falls back to the
default language (via Services.Languages.GetDefaultLanguageId()). If no value is found an empty string is returned.
public string GetName(string languageId)
Parameters
languageIdstringLanguage identifier (case-insensitive).
Returns
- string
The translated name or an empty string when no translation exists.
SetDescription(string, string)
Sets the Description on the translation for languageId. Creates the translation if missing.
public void SetDescription(string languageId, string description)
Parameters
SetName(string, string)
Sets the Name on the translation for languageId. If a translation does not exist it will be created.
public void SetName(string languageId, string name)