Skip to main content

MapPropertyAttribute

Namespace: Riok.Mapperly.Abstractions

Specifies options for a property mapping.

public sealed class MapPropertyAttribute : System.Attribute

Inheritance ObjectAttributeMapPropertyAttribute
Attributes NullableContextAttribute, NullableAttribute, AttributeUsageAttribute, ConditionalAttribute

Properties

Source

Gets the name of the source property.

public IReadOnlyCollection<string> Source { get; }

Property Value

IReadOnlyCollection<String>

SourceFullName

Gets the full name of the source property path.

public string SourceFullName { get; }

Property Value

String

Target

Gets the name of the target property.

public IReadOnlyCollection<string> Target { get; }

Property Value

IReadOnlyCollection<String>

TargetFullName

Gets the full name of the target property path.

public string TargetFullName { get; }

Property Value

String

StringFormat

Gets or sets the format of the ToString conversion (implementing IFormattable).

public string StringFormat { get; set; }

Property Value

String

FormatProvider

Gets or sets the name of a format provider field or property to be used for conversions accepting a format provider (implementing IFormattable). If null the default format provider (annotated with FormatProviderAttribute and FormatProviderAttribute.Defaulttrue) or none (if no default format provider is provided) is used.

public string FormatProvider { get; set; }

Property Value

String

Use

Reference to a unique named mapping method which should be used to map this member.

public string Use { get; set; }

Property Value

String

TypeId

public object TypeId { get; }

Property Value

Object

Constructors

MapPropertyAttribute(String, String)

Maps a specified source property to the specified target property.

public MapPropertyAttribute(string source, string target)

Parameters

source String
The name of the source property. The use of nameof() is encouraged. A path can be specified by joining property names with a '.'.

target String
The name of the target property. The use of nameof() is encouraged. A path can be specified by joining property names with a '.'.

MapPropertyAttribute(String[], String)

Maps a specified source property to the specified target property.

public MapPropertyAttribute(String[] source, string target)

Parameters

source String[]
The path of the source property. The use of nameof() is encouraged.

target String
The name of the target property. The use of nameof() is encouraged. A path can be specified by joining property names with a '.'.

MapPropertyAttribute(String, String[])

Maps a specified source property to the specified target property.

public MapPropertyAttribute(string source, String[] target)

Parameters

source String
The path of the source property. The use of nameof() is encouraged.

target String[]
The path of the target property. The use of nameof() is encouraged.

MapPropertyAttribute(String[], String[])

Caution

Use MapPropertyAttribute(string[], string) or MapPropertyAttribute(string, string[]) instead.


Maps a specified source property to the specified target property.

public MapPropertyAttribute(String[] source, String[] target)

Parameters

source String[]
The path of the source property. The use of nameof() is encouraged.

target String[]
The path of the target property. The use of nameof() is encouraged.