mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 11:50:05 +02:00
feat: deictionary query implemented
This commit is contained in:
1 parent
3e4f34ca16
commit
8a9f2f7077
21 files changed
+972
-69
No files matched your search
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using WotBlitzStatisticsPro.Common.Dictionaries;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.DataAccess.Model;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
|
||||
@@ -36,6 +38,18 @@ namespace WotBlitzStatisticsPro.Logic.Mappers
|
||||
.ForMember(d => d.PriceXp,
|
||||
o =>
|
||||
o.MapFrom(s => s.PricesXp));
|
||||
|
||||
CreateMap<IVehiclesDictionary, VehicleResponse>()
|
||||
.ForMember(v => v.Name,
|
||||
o => o.MapFrom((src, dest, destMember, context) =>
|
||||
src.Name.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value))
|
||||
.ForMember(v => v.Description,
|
||||
o => o.MapFrom((src, dest, destMember, context) =>
|
||||
src.Description.FirstOrDefault(l => l.Language == (RequestLanguage) context.Items["language"])?.Value))
|
||||
.ForMember(v => v.NexTanksInTree,
|
||||
o => o.MapFrom(src => src.NexTanksInTree.Select(t => t.TankId).ToList()))
|
||||
;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user