You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using EntrustSettle.Model.Models;
|
|
|
|
|
using EntrustSettle.Model.Dtos;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace EntrustSettle.Extensions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Mapster 启动服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class MapsterSetup
|
|
|
|
|
{
|
|
|
|
|
public static void AddMapsterSetup(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
//TypeAdapterConfig.GlobalSettings.Default.NameMatchingStrategy(NameMatchingStrategy.Flexible);
|
|
|
|
|
//TypeAdapterConfig.GlobalSettings.Default.PreserveReference(true);
|
|
|
|
|
|
|
|
|
|
// 添加映射规则
|
|
|
|
|
//TypeAdapterConfig<SysUserInfo, SysUserInfoDto>.NewConfig()
|
|
|
|
|
// .TwoWays()
|
|
|
|
|
// .Map(dest => dest.uID, src => src.Id)
|
|
|
|
|
// .Map(dest => dest.RIDs, src => src.RIDs)
|
|
|
|
|
// .Map(dest => dest.addr, src => src.Address)
|
|
|
|
|
// .Map(dest => dest.tdIsDelete, src => src.IsDeleted)
|
|
|
|
|
// .Map(dest => dest.RoleNames, src => src.RoleNames);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|