Skip to content

Enable fluent API #374

@dotnetjunkie

Description

@dotnetjunkie

All Register overloads of the registration API return void. By instead returning an object that describes the made registration, it would allow users and third parties to build extension methods on top of this.

Here are some examples of what can be done on top of this:

// InitializeWith method that forwards to container.RegisterInitializer<TImplementation>()
container.Register<IService, ServiceImpl>().InitializeWith(s => s.Value = configValue);

// Register a configuration value
container.Register<IService, ServiceImpl>().WithConstructorArgument(configurationString);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions