public void GetAll_WhenGetAllElements_ThenReturnedCountIsTheSameLikeInDb() { // Arrange var amountBeforeCreating = db.Pilots.Count(); // Act var returnedCount = service.GetAll().Count; // Assert Assert.AreEqual(returnedCount, amountBeforeCreating); }
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()); }
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)); }
public async Task <ActionResult> Get() { var results = await _pilotService.GetAll(); return(Ok(results)); }
public IActionResult Get() { return(Ok(service.GetAll())); }
public IActionResult Get() { var entites = _pilotService.GetAll(); return(Json(entites)); }
public async Task <IActionResult> GetAll() { return(Json(await _service.GetAll())); }
public async Task <IActionResult> Get() { return(Ok(await service.GetAll())); }