public async Task <GetMatchByIdResponse> GetMatchById(string id)
        {
            var request = new GetMatchByIdRequest(id);

            var result = await _matchActor.Ask <GetMatchByIdResponse>(request);

            return(result);
        }
Exemple #2
0
        public void Handle(GetMatchByIdRequest request)
        {
            try
            {
                var config = new AutoMapper.MapperConfiguration(cfg =>
                {
                    cfg.CreateMap <Match, GetMatchItem>();
                });

                var mapper = config.CreateMapper();

                var match = mapper.Map <GetMatchItem>(_matchRepo.Get(request.Id));

                var response = new GetMatchByIdResponse(match);
                Sender.Tell(response);

                _logger.Info("Get Match by Id: {0}", request.Id);
            }
            catch (Exception ex)
            {
                _logger.Error("Could't get Match by id: {0} : {1}", request.Id, ex);
                throw;
            }
        }
Exemple #3
0
 public object Get(GetMatchByIdRequest request)
 {
     return(this.Db.SingleById <MatchView>(request.Id));
 }