Open sandboxFocus

Method WithInitialize

WithInitialize<T>(T, InitializationMetadata?)

Calls Initialize(InitializationContext) on the object and returns it. This method is emitted by the Metalama Linker at call sites of types implementing IInitializable.

Declaration
public static T WithInitialize<T>(this T obj, InitializationMetadata? metadata = null) where T : IInitializable
Parameters
Type Name Description
T obj

The object to initialize.

InitializationMetadata metadata

Optional metadata describing the initialization context. Pass Modify for with expressions.

Returns
Type Description
T

The same object, after Initialize(InitializationContext) has been called.

Type Parameters
Name Description
T

The type implementing IInitializable.