You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
956 B
C#

11 months ago
using Ds.Module.AppStartup;
using Ds.Module.MediatR;
11 months ago
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace Ds.WMS.Finance.MediatR
{
[DsStartup(10)]
public class MediatRAppStartup : IDynamicStartup
{
public void Configure(WebApplication app)
{
app.UseDeveloperExceptionPage();
11 months ago
}
11 months ago
public void ConfigureServices(WebApplicationBuilder builder)
{
//builder.Services.AddSqlSugarInstall();
11 months ago
var assembly = AppDomain.CurrentDomain.Load("Ds.WMS.Finance.MediatR");
builder.Services.AddMediatR(c =>
{
c.RegisterServicesFromAssembly(assembly);
});
// builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(PerformanceMonitorBehavior<,>));
11 months ago
}
}
}