StaffFile 类和 SaveStaffFileDto 类:员工信息管理模型
public class StaffFile : FullAuditedAggregateRoot
/// 职位名称
///
public Basic_Job Job { set; get; }//数据库外键(生成带id字段)
///
/// 岗位名称
///
public Basic_Post Post { set; get; }//数据库外键(生成带id字段)
}
public class SaveStaffFileDto : ExtensibleObject
{
/// CreateMap<SaveStaffFileDto, StaffFile>().ForMember(dest => dest.Job.Id, opt => opt.MapFrom(src => $"{src.Id}{src.JobId}")); is used to map the properties of the SaveStaffFileDto class to the properties of the StaffFile class.
In this case, it is mapping the JobId property of the SaveStaffFileDto class to the Id property of the Job property of the StaffFile class. The mapping is done by concatenating the Id property of the SaveStaffFileDto class with the JobId property of the SaveStaffFileDto class.
原文地址: https://www.cveoy.top/t/topic/pK6l 著作权归作者所有。请勿转载和采集!