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); }