1
|
using AutoMapper;
|
2
|
using Core.Entities;
|
3
|
using Models.Tags;
|
4
|
using System;
|
5
|
using System.Collections.Generic;
|
6
|
using System.Linq;
|
7
|
using System.Text;
|
8
|
using System.Threading.Tasks;
|
9
|
|
10
|
namespace Core.MapperProfiles
|
11
|
{
|
12
|
public class TagProfileEF : Profile
|
13
|
{
|
14
|
public TagProfileEF()
|
15
|
{
|
16
|
CreateMap<TagCategory, TagCategoryInfo>();
|
17
|
CreateMap<Tag, TagInfo>();
|
18
|
CreateMap<SubTag, SubTagInfo>();
|
19
|
CreateMap<AnnotationTag, TagInstanceInfo>()
|
20
|
.ForMember(ti => ti.OccurenceId, opt => opt.MapFrom(at => at.Id));
|
21
|
|
22
|
// Ignore ID and Annotation
|
23
|
CreateMap<AnnotationTag, FinalAnnotationTag>()
|
24
|
.ForMember(fat => fat.Id, opt => opt.Ignore())
|
25
|
.ForMember(fat => fat.Annotation, opt => opt.Ignore());
|
26
|
|
27
|
CreateMap<FinalAnnotationTag, TagInstanceInfo>();
|
28
|
}
|
29
|
}
|
30
|
}
|