Class BulkCopyableAttribute

Namespace
Wolfgang.Etl.SqlBulkCopy
Assembly
Wolfgang.Etl.SqlBulkCopy.dll

Opts a type into compile-time source-generated property accessors. When a type is marked with this attribute, the Wolfgang.Etl.SqlBulkCopy source generator emits strongly-typed getters for its mappable properties and registers them with Wolfgang.Etl.SqlBulkCopy.GeneratedAccessorRegistry at module load, so the bulk-copy hot path reads values without emitting IL at runtime.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
public sealed class BulkCopyableAttribute : Attribute
Inheritance
BulkCopyableAttribute
Inherited Members

Remarks

The attribute is purely opt-in and additive: an unmarked type continues to work exactly as before, using a getter compiled at runtime with System.Linq.Expressions. Marking a type does not change its mapping — it only changes how the getters are produced (compile time vs runtime), which is what makes the marked type's hot path Native-AOT clean. See ADR 0006.

Generated registration relies on module initializers, which are available on net5.0 and later. On earlier target frameworks the generator emits nothing and the type falls back to the runtime-compiled getter — correct on those JIT-only targets, where runtime IL emission is not a concern.