-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AddMediator(config => ..) not working #112
Comments
Hi! var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMediator(
options =>
{
options.Namespace = "SomeNs";
options.ServiceLifetime = ServiceLifetime.Transient;
}
);
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
var mediator = app.Services.GetRequiredService<SomeNs.Mediator>(); based on the ASP.NET Core sample in this repo. This worked fine, the generated mediator ends up in |
I was using .NETt v6.0 with AutoFac on Windows 11 |
I added a sample for this using Autofac and .NET 6, seemed to work find here, unless I'm missing something.. |
Same issue. Cannot post repro but the abstractions and generator are installed in separate projects. I am not using autofac. builder.Services.AddMediator(options =>
{
options.Namespace = "Properties.API.Mediator";
options.ServiceLifetime = ServiceLifetime.Scoped;
}); produces:
Meanwhile using
works properly Mediator.SourceGenerator 2.1.7 |
The namespace and scope configuration is not respected in v.2.1.7, but in version v2.0.30 it's working fine...
The text was updated successfully, but these errors were encountered: