In the last days I took a watch to the orchad source, and in the bootstrap class during the registration of the components with Autofac I saw same code that I can't explain!!!! I will provide an example:
builder.RegisterType<A>().As<IA>();
{
builder.RegisterType<B>().As<IB>();
{
builder.RegisterType<C>().As<IC>();
}
}
I can't undstand what the brace do? Is it like a sub registration??
Hope somebody can help me!
Thanks
This would be no different than writing:
builder.RegisterType<A>().As<IA>();
builder.RegisterType<B>().As<IB>();
builder.RegisterType<C>().As<IC>();
Surrounding something with braces creates a different context, e.g:
int a = 1;
{
int b = 2;
}
// b not accessible from here
In your case, the function doesn't seem to return anything, and therefore, context doesn't really matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With