27 lines
826 B
C#
27 lines
826 B
C#
using System;
|
|
using AutoMapper;
|
|
using InternshipSystem.Api.Queries;
|
|
using InternshipSystem.Api.Result;
|
|
using InternshipSystem.Core;
|
|
using InternshipSystem.Core.Entity.Internship;
|
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
|
|
|
namespace InternshipSystem.Api
|
|
{
|
|
public class ApiProfile : Profile
|
|
{
|
|
public ApiProfile()
|
|
{
|
|
CreateMap<DocumentPublishRequest, Document>();
|
|
|
|
CreateMap<Edition, EditionResult>()
|
|
.ForMember(
|
|
result => result.Status,
|
|
opt => opt.MapFrom(edition => edition.IsOpen ? "Open" : "Archival"));
|
|
|
|
CreateMap<Edition, EditionConfigurationResult>();
|
|
|
|
CreateMap<EditionSubject, InternshipSubject>().IncludeMembers(es => es.Subject);
|
|
}
|
|
}
|
|
} |