mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
24c4ec2f4d
commit
33b0b2ecb4
1 changed files with 13 additions and 1 deletions
|
|
@ -9,10 +9,19 @@ public class MappingProfiles : Profile
|
|||
{
|
||||
public MappingProfiles()
|
||||
{
|
||||
CreateListSummaryDtoMap();
|
||||
CreateListDetailsDtoMap();
|
||||
CreateListMaintainerDtoMap();
|
||||
CreateListSyntaxDtoMap();
|
||||
}
|
||||
|
||||
private void CreateListSummaryDtoMap() =>
|
||||
CreateMap<Data.Entities.FilterList, ListSummaryDto>()
|
||||
.ForMember(dto => dto.Languages,
|
||||
conf => conf.MapFrom(list => list.FilterListLanguages.Select(listLangs => listLangs.Language)))
|
||||
.ForMember(dto => dto.AddedDate, conf => conf.MapFrom(list => list.CreatedDateUtc));
|
||||
|
||||
private void CreateListDetailsDtoMap() =>
|
||||
CreateMap<Data.Entities.FilterList, ListDetailsDto>()
|
||||
.ForMember(dto => dto.Languages,
|
||||
conf => conf.MapFrom(list => list.FilterListLanguages.Select(listLangs => listLangs.Language.Name)))
|
||||
|
|
@ -20,13 +29,16 @@ public MappingProfiles()
|
|||
conf => conf.MapFrom(list =>
|
||||
list.FilterListMaintainers.Select(listMaints => listMaints.Maintainer)))
|
||||
.ForMember(dto => dto.AddedDate, conf => conf.MapFrom(list => list.CreatedDateUtc));
|
||||
|
||||
private void CreateListMaintainerDtoMap() =>
|
||||
CreateMap<Maintainer, ListMaintainerDto>()
|
||||
.ForMember(dto => dto.AdditionalLists,
|
||||
conf => conf.MapFrom(maint =>
|
||||
maint.FilterListMaintainers.Select(listMaints => listMaints.FilterList)));
|
||||
|
||||
private void CreateListSyntaxDtoMap() =>
|
||||
CreateMap<Syntax, ListSyntaxDto>()
|
||||
.ForMember(dto => dto.SupportedSoftware,
|
||||
conf => conf.MapFrom(syntax => syntax.SoftwareSyntaxes.Select(softSyn => softSyn.Software)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue