mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
AccountInfo history statistics query
This commit is contained in:
1 parent
ec8f434f42
commit
758aa10e55
18 files changed
+522
-28
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using AutoMapper;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.Logic.Calculations;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.Mappers
|
||||
{
|
||||
public class ShortStatisticsProfile: Profile
|
||||
{
|
||||
public ShortStatisticsProfile()
|
||||
{
|
||||
CreateMap<IStatistics, ShortStatistics>()
|
||||
.ForMember(d => d.LastBattleTime,
|
||||
o => o.MapFrom(s => s.LastBattleTime.ToDateTime()))
|
||||
.ForMember(d => d.AvgDamage,
|
||||
o => o.MapFrom(s => s.Battles.HasValue && s.Battles > 0 ? ((decimal)s.DamageDealt / s.Battles) : 0m))
|
||||
.ForMember(d => d.AvgXp,
|
||||
o => o.MapFrom(s => s.Battles.HasValue && s.Battles > 0 ? ((decimal)s.Xp / s.Battles) : 0m))
|
||||
.ForMember(d => d.WinRate,
|
||||
o => o.MapFrom(s => s.Battles.HasValue && s.Battles > 0 ? (100 * (decimal)s.Wins / s.Battles) : 0m))
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user