diff --git a/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj b/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj index 8abd83bd..5905072b 100644 --- a/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj +++ b/src/Yi.Framework/Yi.Framework.Core/Yi.Framework.Core.csproj @@ -7,7 +7,12 @@ - + + + + + + diff --git a/src/Yi.Framework/Yi.Framework.Core/YiFrameworkCoreModule.cs b/src/Yi.Framework/Yi.Framework.Core/YiFrameworkCoreModule.cs index 8178b352..d5b6d357 100644 --- a/src/Yi.Framework/Yi.Framework.Core/YiFrameworkCoreModule.cs +++ b/src/Yi.Framework/Yi.Framework.Core/YiFrameworkCoreModule.cs @@ -26,7 +26,6 @@ namespace Yi.Framework.Core public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) { - //添加全局配置类 services.AddSingleton(new Appsettings(context.Configuration)); //全盘扫描,自动依赖注入 diff --git a/src/Yi.Framework/Yi.Framework.Web/Program.cs b/src/Yi.Framework/Yi.Framework.Web/Program.cs index c92b92d6..5000369f 100644 --- a/src/Yi.Framework/Yi.Framework.Web/Program.cs +++ b/src/Yi.Framework/Yi.Framework.Web/Program.cs @@ -1,7 +1,3 @@ - -using AspNetCore.Microsoft.AspNetCore.Builder; -using Autofac; -using System.Reflection; using Yi.Framework.Application; using Yi.Framework.Application.Contracts; using Yi.Framework.Core; @@ -16,7 +12,7 @@ using Yi.Framework.Domain.Shared; using Yi.Framework.Sqlsugar; using Yi.Framework.Web; - +TimeTest.Start(); var builder = WebApplication.CreateBuilder(args); builder.WebHost.UseUrls(builder.Configuration.GetValue("StartUrl")); @@ -50,4 +46,9 @@ var app = builder.Build(); var t = app.Services.GetService(); app.MapControllers(); + + + + + app.Run(); diff --git a/src/Yi.Framework/Yi.Framework.Web/TimeTest.cs b/src/Yi.Framework/Yi.Framework.Web/TimeTest.cs new file mode 100644 index 00000000..c8e518b2 --- /dev/null +++ b/src/Yi.Framework/Yi.Framework.Web/TimeTest.cs @@ -0,0 +1,23 @@ +using System.Diagnostics; + +namespace Yi.Framework.Web +{ + public class TimeTest + { + public static Stopwatch Stopwatch { get; set; } + + public static void Start() + { + Stopwatch=new Stopwatch(); + Stopwatch.Start(); + } + public static void Result() + { + + Stopwatch.Stop(); + string time = Stopwatch.ElapsedMilliseconds.ToString(); + Console.WriteLine($"本次运行启动时间为:{time}毫秒"); + Stopwatch.Restart(); + } + } +} diff --git a/src/Yi.Framework/Yi.Framework.Web/YiFrameworkWebModule.cs b/src/Yi.Framework/Yi.Framework.Web/YiFrameworkWebModule.cs index fba4306b..7e8267f7 100644 --- a/src/Yi.Framework/Yi.Framework.Web/YiFrameworkWebModule.cs +++ b/src/Yi.Framework/Yi.Framework.Web/YiFrameworkWebModule.cs @@ -34,7 +34,7 @@ namespace Yi.Framework.Web app.UseAuthorization(); app.UseRouting(); - + TimeTest.Result(); } }