添加automapper的依赖注入
This commit is contained in:
@@ -57,6 +57,10 @@ builder.Services.AddSqlsugarServer();
|
||||
#endregion
|
||||
builder.Services.AddQuartzService();
|
||||
#region
|
||||
//AutoMapperע<72><D7A2>
|
||||
#endregion
|
||||
builder.Services.AddAutoMapperService();
|
||||
#region
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#endregion
|
||||
builder.Services.AddControllers(optios => {
|
||||
@@ -150,7 +154,7 @@ app.UseCorsService();
|
||||
#region
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
||||
#endregion
|
||||
app.UseHealthCheckMiddleware();
|
||||
app.UseHealthCheckService();
|
||||
#region
|
||||
//<2F><>Ȩע<C8A8><D7A2>
|
||||
#endregion
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"apollo": {
|
||||
"AppId": "ApiMicroservice",
|
||||
"Env": "DEV",
|
||||
"MetaServer": "http://119.91.207.67:18080",
|
||||
"ConfigServer": [ "http://119.91.207.67:18080" ]
|
||||
"MetaServer": "http://[xxxx]:18080",
|
||||
"ConfigServer": [ "http://[xxxx]:18080" ]
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Yi.Framework.WebCore.Mapper;
|
||||
|
||||
namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
@@ -10,9 +11,9 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
/// </summary>
|
||||
public static class AutoMapperExtension
|
||||
{
|
||||
public static IServiceCollection AddAutoMapperExtensionService(this IServiceCollection services,Type type)
|
||||
public static IServiceCollection AddAutoMapperService(this IServiceCollection services)
|
||||
{
|
||||
services.AddAutoMapper(type);
|
||||
services.AddAutoMapper(typeof(AutoMapperProfile));
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
/// <param name="app"></param>
|
||||
/// <param name="checkPath">默认是/Health</param>
|
||||
/// <returns></returns>
|
||||
public static void UseHealthCheckMiddleware(this IApplicationBuilder app, string checkPath = "/Health")
|
||||
public static void UseHealthCheckService(this IApplicationBuilder app, string checkPath = "/Health")
|
||||
{
|
||||
if (Appsettings.appBool("HealthCheck_Enabled"))
|
||||
{
|
||||
|
||||
@@ -8,13 +8,17 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
[assembly: HostingStartup(typeof(Yi.Framework.WebCore.Utility.CustomHostingStartup))]
|
||||
//这里放上启动类下的dll,即自动侵入了,当然我们现在不会这样做。
|
||||
namespace Yi.Framework.WebCore.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// 必须实现IHostingStartup接口
|
||||
/// 必须标记HostingStartup特性
|
||||
///
|
||||
/// 就像木马一样
|
||||
/// 你小子!还是被你发现了啊,教你一招骚操作!这是一个屌的东西!
|
||||
///
|
||||
/// 我们称它为: 无侵注入! 它彻头彻尾就是一个木马病毒!
|
||||
///
|
||||
/// </summary>
|
||||
public class CustomHostingStartup : IHostingStartup
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user