Class MappingUtilities
Provides some utilities for mapping.
Inheritance
object
MappingUtilities
Namespace: StylelabsStylelabs.MSdkMappers
Assembly: Stylelabs.M.Sdk.dll
Syntax
Methods
AddInvariantIfEmpty(IEnumerable)
Adds to a list of .
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<>CultureInfo | cultures | The cultures. |
Returns
| Type | Description |
|---|---|
| CultureInfo | The extended list of . |
GetCulturesWithoutInvariant(IEnumerable)
Filters a list of by excluding .
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<>CultureInfo | cultures | The cultures. |
Returns
| Type | Description |
|---|---|
| CultureInfo | The filtered cultures. |
MapLabels(IDictionary<CultureInfo, string>)
Maps cultures to labels.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<, >CultureInfostring | dict | The cultures. |
Returns
| Type | Description |
|---|---|
| Dictionary<, >stringstring | The labels. |
MapLabels(IDictionary<string, string>)
Maps labels to cultures.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<, >stringstring | dict | The labels. |
Returns
| Type | Description |
|---|---|
| IDictionary<, >CultureInfostring | The cultures. |
NullableToDate(DateTime?)
Coverts a nullable to a .
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | dateTime | The nullable . |
Returns
| Type | Description |
|---|---|
| DateTime | The . |
NullableToId(long?)
Converts a nullable id to an id.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| long | id | An id. |
Returns
| Type | Description |
|---|---|
| long | A . |
SdkCulturesToLoadOption(IEnumerable)
Creates a load option for the passed cultures, but does not check for invariant culture.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<>CultureInfo | cultures | The cultures. |
Returns
| Type | Description |
|---|---|
| ICultureLoadOption | The ICultureLoadOption. |
ToNullableDate(DateTime)
Converts a to a nullable . will be mapped to null.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | dateTime | A . |
Returns
| Type | Description |
|---|---|
| DateTime | A nullable . |
ToNullableId(long)
Converts an id to a nullable id. 0 will be mapped to null.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| long | id | An id. |
Returns
| Type | Description |
|---|---|
| long | A nullable . |
If you have suggestions for improving this article, let us know!