Table of Contents

Namespace ForgeMap

Classes

AfterForgeAttribute

Calls a method after forging completes for post-processing.

BeforeForgeAttribute

Calls a method before forging begins for pre-processing or validation.

ConvertWithAttribute

Uses a custom converter class for the forging. Available in ForgeMap v1.1+.

ExtractPropertyAttribute

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+.

ForgeAllDerivedAttribute

Generates a polymorphic dispatch method that inspects the runtime type of the source and delegates to the most-specific derived forge method.

ForgeConstructorAttribute

Specifies which constructor on the destination type should be used for mapping. Applied to a forge method to explicitly select a constructor by its parameter types.

ForgeFromAttribute

Maps a destination property using a custom resolver method.

ForgeMapAttribute

Marks a partial class as a ForgeMap forger. The source generator will implement all partial methods in this class.

ForgeMapDefaultsAttribute

Assembly-level defaults for all forgers in the assembly.

ForgePropertyAttribute

Maps a source property to a differently-named destination property.

ForgeWithAttribute

Uses another forging method for a nested property.

IgnoreAttribute

Ignores specified destination properties during forging.

IncludeBaseForgeAttribute

Inherits attribute-based configuration (IgnoreAttribute, ForgePropertyAttribute, ForgeFromAttribute, ForgeWithAttribute) from a base forge method that maps BaseSourceTypeBaseDestinationType. The base forge method must exist in the same forger class.

ReverseForgeAttribute

Generates a reverse forging method automatically.

UseExistingValueAttribute

Marks a parameter as an existing value to forge into (mutate in place).

WrapPropertyAttribute

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+.

Interfaces

ITypeConverter<TSource, TDestination>

Interface for custom type converters. Implement this for complex type transformations that cannot be expressed with ForgeFromAttribute.

Enums

CollectionUpdateStrategy

Specifies how a collection property is updated when ExistingTarget is true.

ConstructorPreference

Controls how the generator selects constructors for destination type instantiation.

NullHandling

Specifies how null source objects should be handled during forging.

NullPropertyHandling

Specifies how nullable source properties should be assigned to non-nullable destination properties. This setting only applies to reference type properties where the source has a nullable annotation and the destination does not.

PropertyMatching

Specifies how properties should be matched between source and destination types.

StringToEnumConversion

Controls automatic string-to-enum conversion behavior for property mappings.