From 4430f49d7a5ce2303633cbeac7ec0c9be05572d1 Mon Sep 17 00:00:00 2001 From: 展杰 <1240968267@qq.com> Date: 星期六, 17 八月 2024 11:24:07 +0800 Subject: [PATCH] 关联条件 物料编号改为物料id --- MESApplication/Startup.cs | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/MESApplication/Startup.cs b/MESApplication/Startup.cs index f506f0e..19d0a1d 100644 --- a/MESApplication/Startup.cs +++ b/MESApplication/Startup.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.SwaggerUI; +using System.Reflection; namespace MESApplication; @@ -35,6 +36,9 @@ c.SwaggerDoc("v1", new OpenApiInfo { Title = "MESApplication.Api", Version = "v1" }); + var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; + var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); + c.IncludeXmlComments(xmlPath, true); }); //閰嶇疆JSON.NET @@ -66,6 +70,14 @@ "OPTIONS") ); }); + + #region 鎺ュ彛琛屽姩杩囨护鍣� + services.AddControllers(options => { + options.Filters.Add(new ActionFilter()); + }); + var serviceProvider = services.BuildServiceProvider(); + ActionFilter.LoggerError = serviceProvider.GetRequiredService<ILogger<ActionFilter>>(); + #endregion } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -92,5 +104,10 @@ app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + + ////////////////////////// + + /////////////////////////// + } } \ No newline at end of file -- Gitblit v1.9.3