Class NoAutoMapProperties
- Assembly
- Cratis.Chronicle.dll
Collects the properties a model excludes from auto-mapping.
public static class NoAutoMapProperties
- Inheritance
-
NoAutoMapProperties
- Inherited Members
Remarks
One implementation for the root read model, a child record and a nested type. The property- and parameter-level exclusion was collected only for the root, so on a child or a nested type the attribute compiled, emitted no diagnostic and did nothing - a colliding event auto-mapped over the value the author had sourced explicitly, and the natural way to debug it (re-read the attributes, confirm the exclusion is there and spelled right) confirmed the wrong conclusion.
Methods
CollectFrom(Type?, INamingPolicy)
Collect the property names a type excludes from auto-mapping.
public static IReadOnlyList<string> CollectFrom(Type? modelType, INamingPolicy namingPolicy)
Parameters
modelTypeTypeThe model Type to collect from.
namingPolicyINamingPolicyThe INamingPolicy the names are converted with.
Returns
- IReadOnlyList<string>
The naming-policy-converted property names to exclude.
Remarks
Records carry the attribute on the primary constructor's parameters, plain models on properties, so both are read. The naming-policy conversion has to be the same one the root uses, because the kernel matches these against a property path's last segment, case-insensitively. NotProjectedAttribute counts as an exclusion too: a member the reader assembles must never be written by the projection, and a subscribed event carrying the same name would otherwise auto-map over it.