Skip to content

Compono.CompositionBuilder.WithCollectionSize(int)

Compono

Compono.CompositionBuilder

CompositionBuilder.WithCollectionSize(int) Method

Sets this composer's global default collection size - the size a generated collection plan builds when no member-scoped .For<T>().Member(x => x.Y).WithCollectionSize(...) override applies. Falls back to the built-in size of 3 if never called. See docs/adr/0020-composition-configuration-rules.md.

public Compono.CompositionBuilder WithCollectionSize(int size);

Parameters

size System.Int32

The default collection size.

Returns

CompositionBuilder

Exceptions

System.ArgumentOutOfRangeException
size is negative.

Remarks

Calling this more than once is a build-time conflict, following the same scalar-fail-fast rule as WithSeed(int).