How to specify constructor when registrating class in asp.net 5 with default Dependecy Injection -
is there possibility instantiate class using asp.net 5
default dependency injection
when class have constructor parameters?
i register repository
constructor accepts connection_string
.
update
i think can rephrase question. specify constructor called when class being registered. similar autofac have. possible?
builder.registertype<configreader>() .as<iconfigreader>() .withparameter("configsectionname", "sectionname");
unfortunately, out of box di container not support parameter constraints. or nothing.
if want advanced features, can switch di container, autofac, mentioned , supported in asp.net 5.
Comments
Post a Comment