|
From: Michael L. <mik...@gm...> - 2011-06-01 08:49:56
|
Hi,
I have various assemblies and a Logger Service that I would like to use in
all various assemblies to log information. I would like to have the member
variable "_logger" in "Service1" and "Service2" available as soon as the
methods "DoSomething1" and "DoSomething2" get called.
I read something about "auto-registration", but am not sure how it works. I
would like to have the configuration in the "Front-End Application" and not
in every single related assembly (Assembly1, Assembly2, etc.)
Any help is greatly appreciated.
Thanks and regards.
Mike
ASSEMBLY 1
*****************
public class Service1
{
IMyLogger _logger;
public void DoSomething1()
{
_logger.LogStuff();
}
}
ASSEMBLY 2
*****************
public class Service2
{
IMyLogger _logger;
public void DoSomething2()
{
_logger.LogStuff();
}
}
ASSEMBLY 3
*****************
public class ServiceLogger
{
public interface ILogger
{
void LogStuff();
}
}
FRONT-END APPLICATION
*********************************
public class MyFrontEnd
{
....
}
|