예제 #1
0
        public async Task <Player> AssignPenaltyToPlayer(int playerId, int penaltyId, [Service] ITopicEventSender eventSender)
        {
            Player p = DemoData.AssignPenalty(penaltyId, playerId);

            if (p == null)
            {
                throw new Exception("PlayerNotFound");
            }
            await eventSender.SendAsync("PenaltyAssigned", p);

            return(p);
        }