Interface IInitializable
An interface to enable polymorphism for types like view model classes etc. that require an explicit (asynchronous) initialization.
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Common.dll
Syntax
public interface IInitializable
Remarks
It's considered bad practice to have a longrunning cobstructor. Also constructors don't have an async context.
Deferring the initilaization of the instance is a convenient way to avoid the shortcommings and code smells.
It's also a clean way to "lazy" initialize expensive resources.
Properties
| Improve this Doc View SourceIsInitialized
Returns whether the instance is already initialized.
Declaration
bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
Methods
| Improve this Doc View SourceInitializeAsync()
Asynchronous method that executes the insatnce initialization routine.
Declaration
Task<bool> InitializeAsync()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | Return |