Ejemplo n.º 1
0
        public ImperialStarDestroyerType(ITieFighterRepository TieFighterRepository)
        {
            Field(x => x.Id).Description("ImperialStarDestroyer id.");
            Field(x => x.Name, nullable: true).Description("ImperialStarDestroyer name.");

            Field <ListGraphType <TieFighterType> >(
                "TieFighters",
                resolve: context => TieFighterRepository.GetTieFightersWithByImperialStarDestroyerIdAsync(context.Source.Id).Result.ToList()
                );
        }
Ejemplo n.º 2
0
        public EasyStoreQuery(IImperialStarDestroyerRepository ImperialStarDestroyerRepository, ITieFighterRepository TieFighterRepository)
        {
            Field <ImperialStarDestroyerType>(
                "spaceship",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "ImperialStarDestroyer id"
            }
                    ),
                resolve: context => ImperialStarDestroyerRepository.GetImperialStarDestroyerAsync(context.GetArgument <int>("id")).Result
                );

            Field <ListGraphType <ImperialStarDestroyerType> >(
                "spaceships",
                resolve: context => ImperialStarDestroyerRepository.GetImperialStarDestroyersAsync());

            Field <TieFighterType>(
                "tiefighter",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id", Description = "TieFighter id"
            }
                    ),
                resolve: context => TieFighterRepository.GetTieFighterAsync(context.GetArgument <int>("id")).Result
                );
        }
Ejemplo n.º 3
0
 public TieFighterRepairService(ITieFighterRepository repository)
 {
     _repository = repository;
 }
Ejemplo n.º 4
0
 public TieFightersController(ITieFighterRepository tieFighterRepository)
 {
     _tieFighterRepository = tieFighterRepository;
 }