Enable fluent API #374

Open
dotnetjunkie opened this Issue Feb 9, 2017 · 0 comments

Projects

None yet

1 participant

@dotnetjunkie
Collaborator

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);
@dotnetjunkie dotnetjunkie added this to the v4 milestone Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment