Class ModelMapping
- Namespace
- Dynamicweb.CoreUI.Data
- Assembly
- Dynamicweb.CoreUI.dll
- Inheritance
-
Model
Mapping
- Inherited Members
Properties
Explanation
Property Value
Hint
Property Value
IsSearchable
Property Value
IsSortable
Property Value
Label
Property Value
Name
Property Value
SystemName
Property Value
ValueType
Property Value
Methods
CreateFromConfigurableProperty<TModel, TValue>(Expression<Func<TModel, TValue>>)
Creates model mapping from model property having Configurable
public static ModelMapping CreateFromConfigurableProperty<TModel, TValue>(Expression<Func<TModel, TValue>> propertyExpression)
Parameters
propertyExpression
Expression<Func<TModel, TValue>>The property mapping expression
Returns
- Model
Mapping Model mapping
Type Parameters
TModel
Mapping value expression input model type
TValue
Mapping value expression output value type
Exceptions
- Argument
Exception Thrown when expression have invalid member target. Must reference a property on
TModel
.- Invalid
Operation Exception Thrown when the property doesn't have Configurable
Property Attribute
Create<TModel, TValue>(Func<TModel?, TValue?>, string, string?, bool, string?, string?, string?, bool)
Creates model mapping with specified value expression, mapping name, label, sortable behavior, system name, hind and explanation
public static ModelMapping Create<TModel, TValue>(Func<TModel?, TValue?> getModelValue, string mappingName, string? systemName = null, bool isSortable = false, string? label = null, string? hint = null, string? explanation = null, bool isSearchable = false)
Parameters
getModelValue
Func<TModel, TValue>The mapping value expression
mappingName
stringMapping name. Required.
systemName
stringMapping system name, if not set - mapping name will be used.
isSortable
boolSortable behavior
label
stringMapping label, if not set - mapping name will be used.
hint
stringHint
explanation
stringExplanation
isSearchable
boolSearchable behavior
Returns
- Model
Mapping Model mapping
Type Parameters
TModel
Mapping value expression input model type
TValue
Mapping value expression output value type
Remarks
Only allowed to use for select providers. Any other cases should be used CreateFromConfigurableProperty<TModel, TValue>(Expression<Func<TModel, TValue>>).
Exceptions
- Argument
Exception Thrown when the mapping name is not specified.
GetValue(object?)
Parameters
model
object