Files
StoreWeb/StoreHub.Services/Mappers/UserMapper.cs
T
2026-08-14 18:00:58 +08:00

20 lines
584 B
C#

using Riok.Mapperly.Abstractions;
using StoreHub.Framework.Models;
using StoreHub.Services.Dtos;
namespace StoreHub.Services.Mappers;
/// <summary>
/// User 实体 → UserDto 映射(Riok.Mapperly 源码生成)。
/// UserDto 只暴露部分字段,因此仅要求目标成员都被映射(忽略源端未映射警告)。
/// </summary>
[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)]
public static partial class UserMapper
{
/// <summary>
/// 将用户实体映射为用户 DTO。
/// </summary>
public static partial UserDto ToDto(User user);
}