From 4f0567c2e02d1bbdfe497dad9b948d3ecf4d3c3a Mon Sep 17 00:00:00 2001 From: liaoxujun@qq.com <liaoxujun@qq.com> Date: 星期三, 26 七月 2023 16:03:13 +0800 Subject: [PATCH] 增加配置文件,增加数据库codefirst --- DocumentServiceAPI.Web.Entry/DocServiceApiStartup.cs | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/DocumentServiceAPI.Web.Entry/DocServiceApiStartup.cs b/DocumentServiceAPI.Web.Entry/DocServiceApiStartup.cs new file mode 100644 index 0000000..cc2d032 --- /dev/null +++ b/DocumentServiceAPI.Web.Entry/DocServiceApiStartup.cs @@ -0,0 +1,30 @@ +锘縰sing DocumentServiceAPI.Core; +using Furion; + +namespace DocumentServiceAPI.Web.Entry +{ + + + public class DocServiceApiStartup: AppStartup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddSqlsugarSetup(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + + + app.DbCodeFirst("DocumentServiceAPI.Model"); + app.UseStaticFiles(new StaticFileOptions + { + OnPrepareResponse = (stf) => + { + stf.Context.Response.Headers["Access-Control-Allow-Origin"] = "*"; + stf.Context.Response.Headers["Access-Control-Allow-Headers"] = "*"; + } + }); + } + } +} -- Gitblit v1.9.1