Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created April 7, 2018 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/cf6a298dfe2e2354e0fae06ff9cc37e0 to your computer and use it in GitHub Desktop.
Save NMZivkovic/cf6a298dfe2e2354e0fae06ff9cc37e0 to your computer and use it in GitHub Desktop.
var builder = new ContainerBuilder();
builder.RegisterType<Client>();
builder.RegisterInstance(new Service1())
.As<IService1>();
builder.RegisterInstance(new Service2())
.As<IService2>().SingleInstance();
var container = builder.Build();
var client = container.Resolve<Client>();
client.InitiateServiceMethods();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment