V1版本
This commit is contained in:
20
CapMachine.Wpf/MapperProfile/CANConfigExdProfile.cs
Normal file
20
CapMachine.Wpf/MapperProfile/CANConfigExdProfile.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class CANConfigExdProfile:Profile
|
||||
{
|
||||
public CANConfigExdProfile()
|
||||
{
|
||||
CreateMap<CANConfigExd, CANConfigExdDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
20
CapMachine.Wpf/MapperProfile/CanLinRWConfigProfile.cs
Normal file
20
CapMachine.Wpf/MapperProfile/CanLinRWConfigProfile.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class CanLinRWConfigProfile : Profile
|
||||
{
|
||||
public CanLinRWConfigProfile()
|
||||
{
|
||||
CreateMap<CanLinRWConfig, CanLinRWConfigDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,17 @@ namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public ChartSelectProfile()
|
||||
{
|
||||
CreateMap<ConfigChartSelect, ChartSelectDto>()
|
||||
CreateMap<ConfigChart, ChartSelectDto>()
|
||||
.ForMember(dest => dest.Index, opt => opt.MapFrom(src => src.Index))
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
|
||||
//.ForMember(dest => dest.Id, opt => opt.Ignore())//忽略目标类中的属性
|
||||
//.ForMember(dest => dest.OrderDate, opt => opt.UserValue<DateTime>(DateTime.Now)); //固定值匹配
|
||||
//.ForMember(dest => dest.TotalAmount, opt => opt.MapFrom(src => src.TotalAmount ?? 0)) //复杂的匹配
|
||||
//.ForMember(dest => dest.EventDate, opt => opt.MapFrom(src => src.WorkEvent.Date)) //属性匹配,匹配源类中WorkEvent.Date到EventDate
|
||||
.ForMember(dest => dest.YAxis, opt => opt.MapFrom(src => src.ConfigChartYAxis))//
|
||||
.ReverseMap();
|
||||
|
||||
CreateMap<HistoryConfigChart, ChartSelectDto>()
|
||||
.ForMember(dest => dest.Index, opt => opt.MapFrom(src => src.Index))
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
|
||||
//.ForMember(dest => dest.Id, opt => opt.Ignore())//忽略目标类中的属性
|
||||
|
||||
15
CapMachine.Wpf/MapperProfile/ChartTabGroupProFile.cs
Normal file
15
CapMachine.Wpf/MapperProfile/ChartTabGroupProFile.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class ChartTabGroupProFile : Profile
|
||||
{
|
||||
public ChartTabGroupProFile()
|
||||
{
|
||||
CreateMap<ChartTabGroupDto, ChartTabGroup>().ReverseMap();
|
||||
CreateMap<ChartTabGroupDto, HistoryChartTabGroup>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
|
||||
19
CapMachine.Wpf/MapperProfile/ConfigLimitProfile.cs
Normal file
19
CapMachine.Wpf/MapperProfile/ConfigLimitProfile.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class ConfigLimitProfile:Profile
|
||||
{
|
||||
public ConfigLimitProfile()
|
||||
{
|
||||
CreateMap<ConfigLimit, ConfigLimitDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
19
CapMachine.Wpf/MapperProfile/ConfigPIDProfile.cs
Normal file
19
CapMachine.Wpf/MapperProfile/ConfigPIDProfile.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class ConfigPIDProfile:Profile
|
||||
{
|
||||
public ConfigPIDProfile()
|
||||
{
|
||||
CreateMap<ConfigPID, ConfigPIDDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
20
CapMachine.Wpf/MapperProfile/ExpInfoProfile.cs
Normal file
20
CapMachine.Wpf/MapperProfile/ExpInfoProfile.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using NPOI.SS.Formula.PTG;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
public class ExpInfoProfile : Profile
|
||||
{
|
||||
public ExpInfoProfile()
|
||||
{
|
||||
CreateMap<ExpInfoDto, HistoryExp>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
23
CapMachine.Wpf/MapperProfile/UserProfile.cs
Normal file
23
CapMachine.Wpf/MapperProfile/UserProfile.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using CapMachine.Model;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using CapMachine.Wpf.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.MapperProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户 的配置
|
||||
/// </summary>
|
||||
public class UserProfile:Profile
|
||||
{
|
||||
public UserProfile()
|
||||
{
|
||||
CreateMap<UserDto, User>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user