dependency injection - Passing in the type of the declaring class for NLog using Autofac -
dependency injection - Passing in the type of the declaring class for NLog using Autofac - following on this question autofac inject type of declaring object constructor of nlog service, can correctly log type logging entries. my nlogservice class looks this... public class nlogservice : ilogservice { private readonly logger _logger; public nlogservice(type t) { var consumertype = t.declaringtype.fullname; _logger = logmanager.getlogger(consumertype); } however fails on app startup because cannot work out inject constructor of nlogservice next error... none of constructors found 'public binding flags' on type 'myproduct.domain.services.logging.nlogservice' can invoked available services , parameters: cannot resolve parameter 'system.type t' of constructor 'void .ctor(system.type)'. so, question - how instruct autofac inject type of calling class? i tried this... public nlogservice(ty...