Example #1
0
        public async Task <RecordViewModel> Handle(GetRecordQuery request, CancellationToken cancellationToken)
        {
            var entity = await _repository.GetRecordById(request.Id, request.UserId);

            var result = _mapper.Map <Record, RecordViewModel>(entity);

            return(result);
        }
Example #2
0
        public async Task <RecordViewModel> GetRecordById(Guid recordId, Guid userId)
        {
            var entity = await _repository.GetRecordById(recordId, userId);

            var result = _mapper.Map <RecordViewModel>(entity);
            var marker = _mapper.Map <MarkerViewModel>(entity.Location);

            result.Location.Marker = marker;
            return(result);
        }