Email notification for LeafWeb jobs

This commit is contained in:
2016-03-09 11:43:44 -05:00
parent 314de4dece
commit e80ddbc4d6
10 changed files with 168 additions and 9 deletions
+10 -3
View File
@@ -1,5 +1,6 @@
using AutoMapper;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Utility;
namespace LeafWeb.Core.Remote
{
@@ -11,6 +12,7 @@ namespace LeafWeb.Core.Remote
public string Filename { get; set; }
public byte[] Contents { get; set; }
public string DirectoryName { get; set; }
public string PhotosyntheticType { get; set; }
static PiscalLeafInputFile()
{
@@ -18,9 +20,14 @@ namespace LeafWeb.Core.Remote
new MapperConfiguration(cfg =>
{
cfg.CreateMap<LeafInputFile, PiscalLeafInputFile>()
.ForMember(dest => dest.DirectoryName, opt => opt.MapFrom(
src => PiscalUtility.GetPiscalDirectoryName(src)))
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id));
.ForMember(dest => dest.DirectoryName,
opt => opt.MapFrom(src => PiscalUtility.GetPiscalDirectoryName(src)))
.ForMember(dest => dest.Filename, opt =>
opt.MapFrom(src => src.Filename.WhitespaceToUnderscore().FilterValidFilename()))
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(
dest => dest.PhotosyntheticType,
opt => opt.MapFrom(src => src.LeafInput.PhotosynthesisType.Id.WhitespaceToUnderscore()));
});
Mapper = config.CreateMapper();
}