-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMappings.cs
32 lines (31 loc) · 1.02 KB
/
Mappings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using LeanKit.API.Client.Library.TransferObjects;
namespace LeanKit.API.ExcelHelper
{
internal class Mappings
{
public static void Initialize()
{
Mapper.CreateMap<Identifier, LeanKitIdentifier>();
Mapper.CreateMap<LaneIdentifier, LeanKitLaneIdentifier>();
Mapper.CreateMap<CardType, LeanKitCardType>();
Mapper.CreateMap<CardView, LeanKitCard>()
.ForMember(s => s.CustomIcon, opt => opt.ResolveUsing(src => src.ClassOfServiceTitle))
.ForMember(s => s.AssignedUsers, opt => opt.ResolveUsing(src =>
{
if (src.AssignedUsers != null && src.AssignedUsers.Count > 0)
{
return src.AssignedUsers.Select(u => u.EmailAddress).ToArray();
}
return new string[0];
}));
Mapper.CreateMap<Lane, LeanKitLane>();
Mapper.CreateMap<Board, LeanKitBoard>();
Mapper.CreateMap<BoardListing, LeanKitBoardListItem>();
Mapper.CreateMap<BoardIdentifiers, LeanKitBoardMetadata>();
Mapper.AssertConfigurationIsValid();
}
}
}