Class ExtractPropertyAttribute
- Namespace
- ForgeMap
- Assembly
- ForgeMap.Abstractions.dll
Marks a partial forge method that returns a single property of the source object.
The method must have signature partial TPrimitive MethodName(TEntity source).
The generator emits a null-guard governed by NullHandling, then returns
source.PropertyName (with built-in coercion if needed for the declared return type).
Available in ForgeMap v1.7+.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public sealed class ExtractPropertyAttribute : Attribute
- Inheritance
-
objectAttributeExtractPropertyAttribute
Constructors
ExtractPropertyAttribute(string)
Creates a new ExtractPropertyAttribute.
public ExtractPropertyAttribute(string propertyName)
Parameters
propertyNamestringName of the readable instance property on the source type to return.
Properties
PropertyName
Gets the name of the source property to extract.
public string PropertyName { get; }
Property Value
- string