agnicore / nfx

.NET Standard Unistack Framework
http://nfxlib.com
Other
75 stars 91 forks source link

Get Child Module by type/name #27

Closed itadapter closed 6 years ago

itadapter commented 6 years ago
/// <summary>
    /// Gets a child module of the specified TModule type optionally applying a filter.
    /// If module is not found then exception is thrown. Contrast with TryGet()
    /// </summary>
    TModule Get<TModule>(Func<TModule, bool> filter = null) where TModule : class, IModule;

    /// <summary>
    /// Tries to get a child module of the specified TModule type optionally applying a filter.
    /// If module is not found then returns null. Contrast with Get()
    /// </summary>
    TModule TryGet<TModule>(Func<TModule, bool> filter = null) where TModule : class, IModule;

    /// <summary>
    /// Gets a child module of the specified TModule type with the specified name.
    /// If module is not found then exception is thrown. Contrast with TryGet()
    /// </summary>
    TModule Get<TModule>(string name) where TModule : class, IModule;

    /// <summary>
    /// Tries to get a child module of the specified TModule type with the specified name.
    /// If module is not found then returns null. Contrast with Get()
    /// </summary>
    TModule TryGet<TModule>(string name) where TModule : class, IModule;
itadapter commented 6 years ago

Done 688ce192720cbaf29f174599c3ddf37b6155d234