Search Results for

    Show / Hide Table of Contents

    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 Source

    IsInitialized

    Returns whether the instance is already initialized.

    Declaration
    bool IsInitialized { get; }
    Property Value
    Type Description
    Boolean

    true when InitializeAsync() was already called, otherwise false.

    Methods

    | Improve this Doc View Source

    InitializeAsync()

    Asynchronous method that executes the insatnce initialization routine.

    Declaration
    Task<bool> InitializeAsync()
    Returns
    Type Description
    Task<Boolean>

    Return true when initialized successfully, otherwise false.

    Extension Methods

    HelperExtensionsCommon.ToDictionary(Object)
    HelperExtensionsCommon.ToFlatDictionary(Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX