30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using AutoMapper;
|
|
using FileService.Application.StorageContracts;
|
|
using FileService.Domain.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace FileService.Application.UploadFileTask
|
|
{
|
|
public class UploadTaskMapperConfig:Profile
|
|
{
|
|
public UploadTaskMapperConfig()
|
|
{
|
|
CreateMap<InitiateUploadResult, TaskInitResponse>()
|
|
.ForMember(dest => dest.StorageLocation, opt => opt.MapFrom(src => src.Location))
|
|
.ForMember(dest => dest.UploadSessionId, opt => opt.MapFrom(src => src.UploadSessionId))
|
|
;
|
|
|
|
CreateMap<UploadTask, UploadTaskResponse>()
|
|
.ForMember(dest => dest.State, opt => opt.MapFrom(src => src.State.ToString()))
|
|
.ForMember(dest => dest.FileSize, opt => opt.MapFrom(src => src.FileSize.ToString()))
|
|
.ForMember(dest => dest.FileName, opt => opt.MapFrom(src => src.FileName.ToString()))
|
|
.ForMember(dest => dest.CheckSum, opt => opt.MapFrom(src => src.CheckSum.Value))
|
|
;
|
|
}
|
|
}
|
|
}
|