Beispiel #1
0
 public StewardController(IPassengerRepository passengerRepository, IProductRepository productRepository, IStewardRepository stewardRepository, IOrderRepository orderRepository)
 {
     _passengerRepository = passengerRepository;
     _productRepository   = productRepository;
     _stewardRepository   = stewardRepository;
     _orderRepository     = orderRepository;
 }
Beispiel #2
0
        partial void AddGamesessionFields(
            IGamesessionRepository gamesessionRepository,
            IStewardRepository stewardRepository,
            IFiefRepository fiefRepository
            )
        {
            FieldAsync <GamesessionQueryResponseType>(
                name: "gamesession",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <GuidGraphType> >
            {
                Name = "gamesessionId"
            },
                    new QueryArgument <StringGraphType>
            {
                Name = "userId"
            }
                    ),
                resolve: async context =>
            {
                var gamesessionId = context.GetArgument <Guid>("gamesessionId");
                var userId        = context.GetArgument <string>("userId");

                return(new GamesessionQueryResponse
                {
                    Gamesession = await gamesessionRepository.GetGamesessionAsync(
                        gamesessionId
                        ),
                    Stewards = await stewardRepository.GetStewardsForGamesessionAndUser(
                        gamesessionId,
                        userId
                        ),
                    Fiefs = await fiefRepository.GetFiefsForGamesessionAndUser(
                        gamesessionId,
                        userId
                        )
                });
            }
                );

            FieldAsync <ListGraphType <GamesessionType> >(
                name: "gamesessions",
                arguments: new QueryArguments(
                    new QueryArgument <StringGraphType>
            {
                Name = "id"
            }
                    ),
                resolve: async context =>
            {
                return(await gamesessionRepository.GetGamesessionsAsync(
                           context.GetArgument <string>("id")
                           ));
            }
                );
        }
Beispiel #3
0
 public RootQueries(
     IBaseEntityRepository <Building> buildingRepository,
     IGamesessionRepository gamesessionRepository,
     IStewardRepository stewardRepository,
     IFiefRepository fiefRepository
     )
 {
     AddBuildingFields(buildingRepository);
     AddGamesessionFields(gamesessionRepository, stewardRepository, fiefRepository);
 }
Beispiel #4
0
 public PersonController(IPassengerRepository passengerRepo, IStewardRepository stewardRepo)
 {
     _passengerRepository = passengerRepo;
     _stewardRepository   = stewardRepo;
 }
Beispiel #5
0
 partial void AddGamesessionFields(IGamesessionRepository repository, IStewardRepository stewardRepository, IFiefRepository fiefRepository);