12345678910111213141516171819202122 |
- using AutoMapper;
- using GxPress.Mappings;
- using Microsoft.Extensions.DependencyInjection;
- namespace GxPress.Api.ServiceExtensions
- {
- public static class AutoMapperExtension
- {
- /// <summary>
- /// 添加映射框架
- /// </summary>
- /// <param name="services"></param>
- /// <returns></returns>
- public static IServiceCollection AddMappers(this IServiceCollection services)
- {
- //ProcessMapping所在程序集的所有Profile都会被注册
- services.AddAutoMapper(typeof(ProcessMapping));
- return services;
- }
- }
- }
|