mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-27 20:30:07 +01:00
chore: Account search extended
This commit is contained in:
1 parent
4ff19d7f21
commit
1d0ab97b35
5 files changed
+131
-8
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using AutoMapper;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
using WotBlitzStatisticsPro.Logic.Calculations;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.Mappers
|
||||
{
|
||||
@@ -12,6 +13,15 @@ namespace WotBlitzStatisticsPro.Logic.Mappers
|
||||
.ForMember(
|
||||
d => d.AccountId,
|
||||
o => o.MapFrom(s => s.AccountId ?? -1));
|
||||
|
||||
CreateMap<WotAccountInfo, AccountsSearchResponseItem>()
|
||||
.ForMember(dest => dest.LastBattle,
|
||||
o => o.MapFrom(s => s.LastBattleTime.ToDateTime()))
|
||||
.ForMember(dest => dest.BattlesCount,
|
||||
o => o.MapFrom(s => s.Statistics!.All!.Battles))
|
||||
.ForMember(dest => dest.WinRate,
|
||||
o => o.MapFrom(s => s.Statistics!.All!.Battles == 0 ? 0 : 100 * s.Statistics!.All!.Wins / s.Statistics!.All!.Battles))
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user