private IEnumerable <string> GeneratePointActionInfo(MatchPointEntity entity)
        {
            var query = (from playerPoint in _playerPointRepository.GetAll()
                         join player in _playerRepository.GetAll() on playerPoint.PlayerId equals player.Id
                         where playerPoint.MatchPointId == entity.Id
                         select $"{player.Name} - {GetActionStringByPointType(playerPoint.PointType)}");

            return(query);
        }
Beispiel #2
0
        public async Task <T> Save <T>(IMatchPointCreateDomainModel model) where T : IMatchPointsSummaryDomainModel, new()
        {
            var entity = new MatchPointEntity();

            if (model.Id != 0)
            {
                entity = await _matchPointRepository.GetByIdAsync(model.Id);
            }

            _mapper.Map(model, entity);
            _matchPointRepository.Add(entity);
            _unitOfWork.CommitChanges();

            return(GetSummary <T>(model.MatchId));
        }