Class WrapPropertyAttribute
- Namespace
- ForgeMap
- Assembly
- ForgeMap.Abstractions.dll
Marks a partial forge method that constructs a new destination object from the source primitive
by assigning or binding it to the named property. The method must have signature
partial TEntity MethodName(TPrimitive source). The destination type must either expose a
constructor parameter of that name, or expose a publicly readable and settable (set or
init) property of that name AND a public parameterless constructor. The generator emits
the appropriate construction form (new TEntity { Prop = source } or
new TEntity(prop: source)), with null-guarding governed by NullHandling.
Available in ForgeMap v1.7+.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class WrapPropertyAttribute : Attribute
- Inheritance
-
objectAttributeWrapPropertyAttribute
Constructors
WrapPropertyAttribute(string)
Creates a new WrapPropertyAttribute.
public WrapPropertyAttribute(string propertyName)
Parameters
propertyNamestringName of the destination property or constructor parameter to assign.
Properties
PropertyName
Gets the name of the destination property or constructor parameter to assign.
public string PropertyName { get; }
Property Value
- string