mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-19 05:31:23 +08:00
18 lines
642 B
C#
18 lines
642 B
C#
using AutoMapper;
|
|
using Util.ObjectMapping.AutoMapper.Tests.Samples;
|
|
|
|
namespace Util.ObjectMapping.AutoMapper.Tests.Configs;
|
|
|
|
/// <summary>
|
|
/// AutoMapper测试配置 - 该配置通过启动器扫描注册
|
|
/// </summary>
|
|
public class TestAutoMapperConfig : IAutoMapperConfig {
|
|
/// <summary>
|
|
/// 配置映射
|
|
/// </summary>
|
|
/// <param name="expression">配置映射表达式</param>
|
|
public void Config( IMapperConfigurationExpression expression ) {
|
|
expression.CreateMap<Sample, Sample4>()
|
|
.ForMember( o => o.StringValue, o => o.MapFrom( ( s, d ) => s.StringValue + "-1" ) );
|
|
}
|
|
} |