Skip to content

Dependency Injection/Auto-wiring #4

Description

@mrousavy

Implement Dependency Injection for interfaces or other properties.

Example:

class LoginModel : Model
{
    [Autowired]
    IDatabase Database { get; }
}

Jellyfish should automatically find the IDatabase implementation (or it is pre-configured before initialization), and initialize the Database { get; } property with that instance. The IDatabase instance is either already initialized somewhere (👍) or initialized by the default constructor (👎)

Example 2:

class LoginModel : Model
{
    IDatabase Database { get; }

    public LoginModel(IDatabase database)
    {
        Database = database;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions