Example #1
0
        public async Task <ActionResult> GetPlane(string id)
        {
            var plane = await _planeRepository.GetPlaneAsync(id);

            if (plane == null)
            {
                return(NotFound());
            }
            return(Ok(plane));
        }
        public async Task <ActionResult> LoadCargo(string id, string planeId)
        {
            var cargo = await _cargoRepository.GetCargoAsync(id);

            if (cargo == null)
            {
                return(NotFound("Cargo Not found"));
            }
            var plane = await _planeRepository.GetPlaneAsync(planeId);

            if (plane == null)
            {
                return(NotFound("Plane Not found"));
            }
            var result = await _cargoRepository.LoadCargoAsync(id, planeId);

            return(Ok(result));
        }