Ejemplo n.º 1
0
        public async Task <AddAirplaneResponse> Handle(AddAirplane request, CancellationToken cancellationToken)
        {
            var aircraftType = await _aircraftTypeRepository.GetById(request.AircraftTypeId);

            var airplane = _factory.Airplane(request, aircraftType);

            await _airplaneRepository.AddEntity(airplane);

            return(_factory.AddAirplaneResponse(airplane));
        }
        public async Task <GetAircraftTypeByIdResponse> Handle(GetAircraftTypeById request, CancellationToken cancellationToken)
        {
            var aircraftType = await _repository.GetById(request.Id);

            return(_factory.GetAircraftTypeByIdResponse(aircraftType));
        }