添加了数据处理服务
This commit is contained in:
32
Profiles/MappingProfile.cs
Normal file
32
Profiles/MappingProfile.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using PMSWPF.Data.Entities;
|
||||
using PMSWPF.Models;
|
||||
|
||||
namespace PMSWPF.Profiles;
|
||||
|
||||
/// <summary>
|
||||
/// AutoMapper 的配置类,用于定义对象之间的映射规则。
|
||||
/// </summary>
|
||||
public class MappingProfile : Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
// --- 用户映射 ---
|
||||
|
||||
|
||||
// --- 设备映射 (包含List的父对象) ---
|
||||
// AutoMapper 会自动使用上面的规则来处理 VariableTables 属性
|
||||
CreateMap<DbDevice, Device>().ReverseMap();
|
||||
|
||||
// --- 变量表映射 (List中的元素) ---
|
||||
CreateMap<DbVariableTable, VariableTable>().ReverseMap();
|
||||
|
||||
CreateMap<DbVariableData, VariableData>().ReverseMap();
|
||||
// --- MQTT 和 变量数据 映射 ---
|
||||
CreateMap<DbMqtt, Mqtt>().ReverseMap();
|
||||
|
||||
CreateMap<DbMenu, MenuBean>().ReverseMap();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user