Add WebCms
This commit is contained in:
@@ -6,8 +6,6 @@ namespace LeafWeb.Core.Remote
|
||||
{
|
||||
public class PiscalLeafOutputFile
|
||||
{
|
||||
private static readonly IMapper Mapper;
|
||||
|
||||
public string Filename { get; set; }
|
||||
public byte[] Contents { get; set; }
|
||||
public string PiscalDirectoryName { get; set; }
|
||||
@@ -17,30 +15,25 @@ namespace LeafWeb.Core.Remote
|
||||
|
||||
static PiscalLeafOutputFile()
|
||||
{
|
||||
var config =
|
||||
new MapperConfiguration(cfg =>
|
||||
{
|
||||
cfg.CreateMap<PiscalLeafOutputFile, LeafOutputFile>()
|
||||
.ForMember(dest => dest.FileContents, opt =>
|
||||
opt.ResolveUsing(src => new LeafOutputFileContents {Contents = src.Contents}))
|
||||
.ForMember(dest => dest.FileType, opt =>
|
||||
opt.ResolveUsing(src =>
|
||||
{
|
||||
switch (src.OutputFileType)
|
||||
{
|
||||
case "touser":
|
||||
return LeafOutputFileType.ToUser;
|
||||
case "nottouser":
|
||||
return LeafOutputFileType.NotToUser;
|
||||
case "clninput":
|
||||
return LeafOutputFileType.CleanedInput;
|
||||
default:
|
||||
throw new ArgumentException();
|
||||
}
|
||||
Mapper.CreateMap<PiscalLeafOutputFile, LeafOutputFile>()
|
||||
.ForMember(dest => dest.FileContents, opt =>
|
||||
opt.ResolveUsing(src => new LeafOutputFileContents {Contents = src.Contents}))
|
||||
.ForMember(dest => dest.FileType, opt =>
|
||||
opt.ResolveUsing(src =>
|
||||
{
|
||||
switch (src.OutputFileType)
|
||||
{
|
||||
case "touser":
|
||||
return LeafOutputFileType.ToUser;
|
||||
case "nottouser":
|
||||
return LeafOutputFileType.NotToUser;
|
||||
case "clninput":
|
||||
return LeafOutputFileType.CleanedInput;
|
||||
default:
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
Mapper = config.CreateMapper();
|
||||
}));
|
||||
}
|
||||
|
||||
public PiscalLeafOutputFile() { }
|
||||
|
||||
Reference in New Issue
Block a user