添加automapper的依赖注入
This commit is contained in:
@@ -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