refactor: Integrate Autofac

gui
Robert Dailey 2 years ago
parent 77df3038aa
commit bffaad05ee

@ -0,0 +1,11 @@
using Autofac;
namespace Recyclarr.Gui;
public static class CompositionRoot
{
public static void Setup(ContainerBuilder builder)
{
}
}

@ -1,12 +1,17 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using MudBlazor.Services;
using Recyclarr.Gui;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddMudServices();
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureContainer<ContainerBuilder>(CompositionRoot.Setup);
var app = builder.Build();
// Configure the HTTP request pipeline.

@ -2,6 +2,7 @@
<ItemGroup>
<PackageReference Include="Autofac" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="MudBlazor" Version="6.*" />
<PackageReference Include="ReactiveUI.Blazor" Version="18.*" />
</ItemGroup>

Loading…
Cancel
Save