Skip to content

Compono.CompositionBuilder.WithSeed(int)

Compono

Compono.CompositionBuilder

CompositionBuilder.WithSeed(int) Method

Sets this composer's explicit root seed - the same seed produces the same composed output (for a given Compono package version) across every Create<T>()/ CreateMany<T>(int) call this composer ever serves. Without this call, each root composition operation generates its own seed.

public Compono.CompositionBuilder WithSeed(int seed);

Parameters

seed System.Int32

The explicit root seed.

Returns

CompositionBuilder

Remarks

Calling this more than once (directly, or once directly and once from a profile, or from two different profiles) is a configuration conflict, not last-write-wins - surfaced as a CompositionConfigurationException once Create(Action<CompositionBuilder>)'s validation runs, not immediately. See docs/adr/0017-immutable-composer-configuration-and-builder-model.md's Amendment for why: two different seeds configured for the same composer has no coherent "effective" value the way a typical options-builder's last-write-wins convention would assume.