Compono.CompositionBuilder.AddProfile
Compono¶
Compono.CompositionBuilder¶
CompositionBuilder.AddProfile Method¶
| Overloads | |
|---|---|
| AddProfile(ICompositionProfile) | Applies profile's Configure(CompositionBuilder) to this builder immediately, synchronously - the instance-based counterpart to AddProfile<TProfile>(), for a profile that needs constructor arguments or is already an instance. |
| AddProfile<TProfile>() | Applies TProfile's Configure(CompositionBuilder) to this builder immediately, synchronously - constructed via an ordinary, reflection-free new(). |
CompositionBuilder.AddProfile(ICompositionProfile) Method¶
Applies profile's Configure(CompositionBuilder) to this builder immediately, synchronously - the instance-based counterpart to AddProfile<TProfile>(), for a profile that needs constructor arguments or is already an instance.
Parameters¶
profile ICompositionProfile
The profile instance to apply.
Returns¶
Exceptions¶
CompositionConfigurationException
Applying profile would create a cycle (by its declared CLR type) - thrown immediately, containing exactly one ProfileCycle error naming the full chain.
CompositionBuilder.AddProfile\<TProfile>() Method¶
Applies TProfile's Configure(CompositionBuilder) to this builder immediately, synchronously - constructed via an ordinary, reflection-free new().
public Compono.CompositionBuilder AddProfile<TProfile>()
where TProfile : Compono.ICompositionProfile, new();
Type parameters¶
TProfile
The profile type to construct and apply.
Returns¶
Exceptions¶
CompositionConfigurationException
Applying TProfile would create a cycle - thrown immediately, containing exactly one ProfileCycle error naming the full chain.
Remarks¶
A profile applied while another profile of the exact same declared type is already applying (directly or nested several levels deep) is a cycle - see docs/adr/0018-composition-profiles.md.