Table of Contents

Class ModelMapping

Namespace
Dynamicweb.CoreUI.Data
Assembly
Dynamicweb.CoreUI.dll
public sealed class ModelMapping
Inheritance
ModelMapping
Inherited Members

Properties

Explanation

public string Explanation { get; init; }

Property Value

string

Hint

public string Hint { get; init; }

Property Value

string

IsSearchable

public bool IsSearchable { get; init; }

Property Value

bool

IsSortable

public bool IsSortable { get; init; }

Property Value

bool

Label

public string Label { get; init; }

Property Value

string

Name

public required string Name { get; init; }

Property Value

string

SystemName

public required string SystemName { get; init; }

Property Value

string

ValueType

public Type? ValueType { get; init; }

Property Value

Type

Methods

CreateFromConfigurableProperty<TModel, TValue>(Expression<Func<TModel, TValue>>)

Creates model mapping from model property having ConfigurablePropertyAttribute.

public static ModelMapping CreateFromConfigurableProperty<TModel, TValue>(Expression<Func<TModel, TValue>> propertyExpression)

Parameters

propertyExpression Expression<Func<TModel, TValue>>

The property mapping expression

Returns

ModelMapping

Model mapping

Type Parameters

TModel

Mapping value expression input model type

TValue

Mapping value expression output value type

Exceptions

ArgumentException

Thrown when expression have invalid member target. Must reference a property on TModel.

InvalidOperationException

Thrown when the property doesn't have ConfigurablePropertyAttribute

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 string

Mapping name. Required.

systemName string

Mapping system name, if not set - mapping name will be used.

isSortable bool

Sortable behavior

label string

Mapping label, if not set - mapping name will be used.

hint string

Hint

explanation string

Explanation

isSearchable bool

Searchable behavior

Returns

ModelMapping

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

ArgumentException

Thrown when the mapping name is not specified.

GetValue(object?)

public object? GetValue(object? model)

Parameters

model object

Returns

object
To top