I work in a solution with multiple projects split up using multilayer architecture. I manage to inject services from my BLL.Umbraco project using a registry compiler. But I also want to be able to inject my UnitOfWork (those in my DAL project) as my AccountService injects them. I can't handle DAL in BLL.Umbraco. What is the best way to do this?
namespace BLL.Umbraco.Composing
{
internal class RegisterServicesComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.Register<IAccountService, AccountService();
}
}
}
I would place the Composer in the Website, as it has access to both areas,
You can abstract the registrations easily as they are normally composed of
Service Type
Service Implementation
Lifetime
Then you can wrap the Composition and let your projects contain the registration logic without knowing anything about Umbraco, but the registration/execution happens in the website during boot
The small composition abstraction interface could be placed in a shared library, and the actual implementation could be placed in BLL.Umbraco to be reusable across sites
LightInject MultiArchitecture Project
I work in a solution with multiple projects split up using multilayer architecture. I manage to inject services from my BLL.Umbraco project using a registry compiler. But I also want to be able to inject my UnitOfWork (those in my DAL project) as my AccountService injects them. I can't handle DAL in BLL.Umbraco. What is the best way to do this? namespace BLL.Umbraco.Composing
I would place the Composer in the Website, as it has access to both areas, You can abstract the registrations easily as they are normally composed of
Then you can wrap the Composition and let your projects contain the registration logic without knowing anything about Umbraco, but the registration/execution happens in the website during boot
The small composition abstraction interface could be placed in a shared library, and the actual implementation could be placed in BLL.Umbraco to be reusable across sites
is working on a reply...