I have an Entity
class that exposes a read-only Id property. This property gets set via an ORM after it is saved (no longer transient). I'd like to have AutoFixture call a method that sets the Id property internally for all instances of classes that inherit from Entity.
There are several customizations being applied to the fixture that register the creation of a select few of these descendants, so I'd like to ensure they run first. I guess the ideal situation would be to allow me to run some modification code to an anonymous value before it is returned from the fixture.
For example, when I call fixture.CreateAnonymous<Order>()
, there would be some other customization (or the like) that can modify that Order instance before it is returned.
This modification would not intercept just Order
, but any Entity
descendant.