1 |
b9c5b7dd
|
Vojtěch Bartička
|
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 |
2ebf32d0
|
Vojtěch Bartička
|
CreateMap<AnnotationTag, TagInstanceInfo>()
|
20 |
|
|
.ForMember(ti => ti.OccurenceId, opt => opt.MapFrom(at => at.Id));
|
21 |
440997e0
|
Vojtěch Bartička
|
|
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 |
8c9ce202
|
Vojtěch Bartička
|
|
27 |
|
|
CreateMap<FinalAnnotationTag, TagInstanceInfo>();
|
28 |
b9c5b7dd
|
Vojtěch Bartička
|
}
|
29 |
|
|
}
|
30 |
|
|
}
|