public async Task <IEnumerable <ServiceBlModelResponseForTicket> > GetServices(int sessionId)
        {
            DalSessionModelResponse session = await _sessionRepository.GetSessionById(sessionId);

            if (session == null)
            {
                return(null);
            }

            IEnumerable <ServiceDalDtoModelResponseForTicket> services = await _sessionRepository.GetServices(sessionId);

            return(services.Select(Mapper.Map <ServiceBlModelResponseForTicket>));
        }
Esempio n. 2
0
 public IActionResult Export(Guid id)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     try {
         var session = _repository.GetSessionById(id);
         if (session == null)
         {
             return(NotFound());
         }
         _exportService.ExportSession(session);
         return(Ok());
     } catch (Exception) {
         return(StatusCode(500));
     }
 }
        public IActionResult GetSessionById(Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var session = _repository.GetSessionById(id);
                _telemetryClient.TrackEvent("SessionReadById", new Dictionary <string, string>
                {
                    { "sessionId", id.ToString() }
                });
                _telemetryClient.Flush();
                return(Ok(session));
            }
            catch (IndexOutOfRangeException)
            {
                return(NotFound());
            }
        }