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.
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Ds.Module.AppStartup;
|
|
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();
|
|
}
|
|
|
|
public void ConfigureServices(WebApplicationBuilder builder)
|
|
{
|
|
//builder.Services.AddSqlsugarInstall();
|
|
var assembly = AppDomain.CurrentDomain.Load("Ds.WMS.Finance.MediatR");
|
|
|
|
builder.Services.AddMediatR(c =>
|
|
{
|
|
c.RegisterServicesFromAssembly(assembly);
|
|
});
|
|
|
|
//builder.Services.AddSwaggerGen(c =>
|
|
// {
|
|
// c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" });
|
|
// var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
|
// var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
|
// c.IncludeXmlComments(xmlPath);
|
|
// });
|
|
}
|
|
}
|
|
} |