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() ); }
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 ); }
public TieFighterRepairService(ITieFighterRepository repository) { _repository = repository; }
public TieFightersController(ITieFighterRepository tieFighterRepository) { _tieFighterRepository = tieFighterRepository; }