In my Startup class I a have method for RegisterAssemblyTypes through autofac as the following:
public class Startup
{
public void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterModule(new ApplicationModule());
}
}
public class ApplicationModule : Autofac.Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterAssemblyTypes(
typeof(EventHandler).GetTypeInfo().Assembly)
.AsClosedTypesOf(typeof(IIntegrationEventHandler<>));
}
}
What is the suggested way of registering assemblies using Autofac (e.g., RegisterAssemblyTypes) when the Startup class is called from integration tests; e.g.,
public class IntegrationTestApplicationFactory : WebApplicationFactory<Startup>
{ }
I am using Autofac 4.9.4.
Question:
how do you register an assembly type in WebApplicationFactory<Startup> using Autofac?