Skip to content

Generate factory method instead of extension method #34

@JohanLarsson

Description

@JohanLarsson

Before:

class C
{
    private readonly IDisposable container;

    public C()
    {
        this.container =new Container<Foo>();
    }
}

After:

class C
{
    private readonly IDisposable container;

    public C()
    {
        this.container = CreateContainer();
    }

    private static Container<Foo> CreateContainer()
    {
        return new Container<Foo>()
               .Bind(x => new Foo(x.Get<Bar>()))
               .Bind(() => new Bar());
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions