添加automapper的依赖注入

This commit is contained in:
橙子
2022-04-12 22:12:11 +08:00
parent 4d2c105c89
commit 750352dba7
5 changed files with 16 additions and 7 deletions

View File

@@ -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;
}
}