Provides a base class with simple builder functionality.
More...
|
| TBuilder | WithProp (ActionRef< TEntity > transform) |
| | Generic property mutator to apply to built entity of pass-by-value type (eg a struct)
|
| |
| TBuilder | WithProp (Action< TEntity > transform) |
| | Generic property mutator to apply to built entity of pass-by-ref type (eg class)
|
| |
| virtual TEntity | Build () |
| | Attempts to:
|
| |
|
|
static TBuilder | Create () |
| | Creates an instance of this builder; used for fluent code like: SomeBuilder.Create() .WithStuff() .Build();.
|
| |
| static TEntity | BuildDefault () |
| | Builds a default instance of TEntity based on your builder's ConstructEntity and Build methods (ie convenience wrapper around YourBuilder.Create().Build())
|
| |
|
| virtual TEntity | ConstructEntity () |
| | Allows the derivative class to implement a custom strategy for entity construction; for example:
|
| |
Provides a base class with simple builder functionality.
- Template Parameters
-
- Type Constraints
-
| TBuilder | : | Builder | |
| TBuilder | : | TBuilder | |
| TBuilder | : | TEntity | |
| TBuilder | : | IBuilder | |
| TBuilder | : | TBuilder | |
| TBuilder | : | TEntity | |
| TBuilder | : | new() | |
◆ Build()
◆ BuildDefault()
Builds a default instance of TEntity based on your builder's ConstructEntity and Build methods (ie convenience wrapper around YourBuilder.Create().Build())
- Returns
◆ ConstructEntity()
Allows the derivative class to implement a custom strategy for entity construction; for example:
- providing constructor parameters
- returning an implementation for an interface
- Returns
◆ WithProp() [1/2]
◆ WithProp() [2/2]
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/Builder.cs