jbrechtel/plant — pull request #12 by jagregory (2012-02-03 04:14:01+00:00)
Title: Strongly typed Create and Define methods

This has been useful for me when working in situations where intellisense is useful, or the properties are changing fairly frequently; the anonymous objects work nicely, but R# doesn't pick up that they're actually representing the properties on another object.

> You can now define blueprints (and create objects too) using the following syntax:
>
> p.DefinePropertiesOf(new Person {
> FirstName = "James"
> });
> p.Create(new Person { FirstName = "James" });
>
> This approach is strongly typed, and prevents some of the typo and refactoring induced errors that can occur from using anonymous objects. Obviously, this approach is only applicable if your object has a default constructor (and doesn't do anything nasty in there).