robdmoore/NTestDataBuilder — pull request #9 by Quantumplation (2014-10-03 03:22:21+00:00)
Title: Added an alteration step for normal objects.

Similar to how Proxy objects have an additional Alter step, normal objects now include an Alter method.

As a specific motivating example, at work, everything stored to the database derives from Persistable. So, I would like to provide a base PersistableBuilder class, which has a .PersistedTo(IUnitOfWork) method for every derived builder. However, I have no access to the objects produced in the child classes without basically this same solution. It seemed like it would be useful to the rest of the project, so I included it at the root.

One thing that I was unsure on was whether Alter should be void return type, as with Proxy, or type T->T. I chose to go with T->T, as it allows you to return entirely different objects if you really want, but I didn't have a use for that and you might want to make that simplification to the interface before merging it in.