Exemplo n.º 1
0
        public ActionResult <Fight> Get(Guid id)
        {
            var result = _fightService.GetFightById(id);

            if (result == null)
            {
                return(NotFound());
            }
            return(new Fight
            {
                Id = result.Id,
                PlayerId = result.PlayerId,
                BotId = result.BotId,
                FightLogs = result.FightLogs.Select(s => new FightLog
                {
                    Id = s.Id,
                    Turn = s.Turn,
                    PlayerHitPoint = s.PlayerHitPoint,
                    BotHitPoint = s.BotHitPoint,
                    LogEntry = s.LogEntry
                }).OrderByDescending(log => log.Turn)
            });
        }