Ejemplo n.º 1
0
        public Task <AircraftTypeModel[]> AircraftTypes([Inject] IAircraftTypeReadRepository repository)
        {
            var query = repository.GetQuery();

            query = query.Fetch(x => x.SeatsByFlightDuration);

            return(Task.FromResult(query.ToArray()));
        }
        public RemoveAircraftTypesResult RemoveAircraftTypes(NonNull <RemoveAircraftTypesParams> @params)
        {
            _commandRouter.Send(new RemoveAircraftTypes
            {
                AggregateIds = @params.Value.Ids.Value
            });

            var totalRemoved = @params.Value.Ids.Value.Count;

            return(new RemoveAircraftTypesResult
            {
                TotalRemoved = totalRemoved,
                ClientMutationId = @params.Value.ClientMutationId,
                AircraftTypes = _aircraftTypeReadRepository.GetQuery().ToList()
            });
        }