public void GetAll_WhenGetAllElements_ThenReturnedCountIsTheSameLikeInDb()
        {
            // Arrange
            var amountBeforeCreating = db.Pilots.Count();

            // Act
            var returnedCount = service.GetAll().Count;

            // Assert
            Assert.AreEqual(returnedCount, amountBeforeCreating);
        }
예제 #2
0
        public IList <CrewDetails> GetAllDetails()
        {
            var crews        = GetAll();
            var pilots       = _pilotService.GetAll();
            var airhostesses = _airhostessService.GetAll();

            var joined = from crew in crews
                         join pilot in pilots on crew.PilotId equals pilot.Id
                         join airhostess in airhostesses
                         on crew.Id equals airhostess.CrewId into crewAirhostesses
                         select CrewDetails.Create(crew, pilot, crewAirhostesses);

            return(joined.ToList());
        }
예제 #3
0
        public IActionResult Get()
        {
            IEnumerable <PilotDto> pilotDtos;

            try
            {
                pilotDtos = pilotService.GetAll();
            }
            catch (Exception ex)
            {
                return(BadRequest(new { ErrorType = ex.GetType().Name, ex.Message }));
            }

            return(Ok(pilotDtos));
        }
예제 #4
0
        public async Task <ActionResult> Get()
        {
            var results = await _pilotService.GetAll();

            return(Ok(results));
        }
예제 #5
0
 public IActionResult Get()
 {
     return(Ok(service.GetAll()));
 }
예제 #6
0
        public IActionResult Get()
        {
            var entites = _pilotService.GetAll();

            return(Json(entites));
        }
예제 #7
0
 public async Task <IActionResult> GetAll()
 {
     return(Json(await _service.GetAll()));
 }
예제 #8
0
 public async Task <IActionResult> Get()
 {
     return(Ok(await service.GetAll()));
 }