diff --git a/SoEasyPlatform/Apis/CodeTableApp/CodeTableController.cs b/SoEasyPlatform/Apis/CodeTableApp/CodeTableController.cs index 50fcb0b6f52679840d4ffb27386cd814b84e0b63..4dc18189a5504a72e7e5aa2d1a3415550a66e7b7 100644 --- a/SoEasyPlatform/Apis/CodeTableApp/CodeTableController.cs +++ b/SoEasyPlatform/Apis/CodeTableApp/CodeTableController.cs @@ -352,7 +352,7 @@ namespace SoEasyPlatform.Apis var tableDb = base.GetTryDb(dbid); var dts = Export(model, tableDb); var bytes = Table_ToExcel.ExportExcel(dts, "数据库文档.xlsx"); - var url = FileSugar.MergeUrl(Startup.GetCurrentDirectory(), "excel/数据库文档" + SqlSugar.SnowFlakeSingle.Instance.getID() + ".xlsx"); + var url = FileSugar.MergeUrl(Startup.CurrentDirectory, "excel/数据库文档" + SqlSugar.SnowFlakeSingle.Instance.getID() + ".xlsx"); FileSugar.CreateFile(url, bytes); OpenPath(url); return result; diff --git a/SoEasyPlatform/Code/AppStart/Services.cs b/SoEasyPlatform/Code/AppStart/Services.cs index 97900b1a5fe8f08daefcedfd7121936ad0817f80..90e45e4ac8ca3ef75acfafa82011418d26260a8a 100644 --- a/SoEasyPlatform/Code/AppStart/Services.cs +++ b/SoEasyPlatform/Code/AppStart/Services.cs @@ -1,13 +1,8 @@ -using AutoMapper; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -namespace SoEasyPlatform +namespace SoEasyPlatform { public class Services { @@ -18,8 +13,7 @@ namespace SoEasyPlatform services.AddAutoMapper(typeof(SoEasyPlatform.MapperProfiles).Assembly); #if DEBUG //启用动态编译 - services.AddControllersWithViews() - .AddRazorRuntimeCompilation(); + services.AddControllersWithViews().AddRazorRuntimeCompilation(); #endif services.AddControllersWithViews().AddNewtonsoftJson(opt => { diff --git a/SoEasyPlatform/Pages/Template.cshtml b/SoEasyPlatform/Pages/Template.cshtml index 1b7242d758fd7ee1fe3881af434180d61b6b9ecf..0481dd43e8c42c07d0f1c7cab6e660f815d626dc 100644 --- a/SoEasyPlatform/Pages/Template.cshtml +++ b/SoEasyPlatform/Pages/Template.cshtml @@ -51,9 +51,9 @@
- + - +
@*
diff --git a/SoEasyPlatform/Program.cs b/SoEasyPlatform/Program.cs index 7c36f4383a3918f240be4117029bb7d7ee69ea86..04927ac9ae43dee9fd0cb941e7eff02de50d9ba1 100644 --- a/SoEasyPlatform/Program.cs +++ b/SoEasyPlatform/Program.cs @@ -1,26 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Builder; +using SoEasyPlatform; +using SqlSugar.IOC; -namespace SoEasyPlatform +var builder = WebApplication.CreateBuilder(args); +Services.AddServices(builder.Services); +builder.Services.AddSqlSugar(new SqlSugar.IOC.IocConfig() { - public class Program + ConfigId = "master1", + DbType = IocDbType.Sqlite, + IsAutoCloseConnection = true, + ConnectionString = "DataSource=" + Startup.CurrentDirectory + @"\database\sqlite.db" +}); +builder.Services.ConfigurationSugar(db => +{ + if (!db.ConfigQuery.Any()) { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); + db.ConfigQuery.SetTable