How to use it?
Topshelf.LightCore supplies Topshelf with extensions
to resolve services using LightCore.
Simply start out by configuring the LightCore-container as usual, then
use the UseLightCore-extension when setting up the HostFactory.
To constuct a service use the ConstructUsingLightCore-extension.
Example:
// setup LightCore
var builder = new ContainerBuilder();
/* some fancy setup here */
var container = builder.Build();
// setup Topshelf
var host = HostFactory.Run(x =>
{
x.UseLightCore(container); // Enable LightCore
x.Service(s =>
{
s.ConstructUsingLightCore(); // Construct SomeSevice using LightCore
s.WhenStarted(tc => tc.Start());
s.WhenStopped(tc => tc.Stop());
/* more Topshelf code... */
});
});