DataServices 现场调试OK
This commit is contained in:
35
FATrace.WPLApp/MapperProfile/MapperConfig.cs
Normal file
35
FATrace.WPLApp/MapperProfile/MapperConfig.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using AutoMapper;
|
||||
using FATrace.WPLApp.Services;
|
||||
using Prism.Ioc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FATrace.WPLApp.MapperProfile
|
||||
{
|
||||
public class MapperConfig : IMapperProvider
|
||||
{
|
||||
private readonly MapperConfiguration _Configuration;
|
||||
|
||||
public MapperConfig(IContainerProvider container)
|
||||
{
|
||||
_Configuration = new MapperConfiguration(configure =>
|
||||
{
|
||||
//var assemblys = AppDomain.CurrentDomain.GetAssemblies();
|
||||
//configure.AddMaps(assemblys);
|
||||
|
||||
configure.ConstructServicesUsing(container.Resolve);
|
||||
|
||||
//扫描profile文件
|
||||
configure.AddMaps(AppDomain.CurrentDomain.GetAssemblies());
|
||||
});
|
||||
}
|
||||
|
||||
public IMapper GetMapper()
|
||||
{
|
||||
return _Configuration.CreateMapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
20
FATrace.WPLApp/MapperProfile/RawProUseProfile.cs
Normal file
20
FATrace.WPLApp/MapperProfile/RawProUseProfile.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using AutoMapper;
|
||||
using FATrace.Model;
|
||||
using FATrace.WPLApp.ModelDto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FATrace.WPLApp.MapperProfile
|
||||
{
|
||||
public class RawProUseProfile : Profile
|
||||
{
|
||||
public RawProUseProfile()
|
||||
{
|
||||
CreateMap<RawProUse, RawProUserCsvDto>().ReverseMap();
|
||||
CreateMap<RawProUse, RawProUseDto>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user