public FieldQuery(IScoreCardRepository scoreCardRepository) { Field <ListGraphType <FieldType> >("fields", resolve: context => scoreCardRepository.GetFields()); Field <FieldType>( "fieldById", arguments: new QueryArguments( new QueryArgument <IdGraphType> { Name = "id" } ), resolve: context => { var id = context.GetArgument <int>("id"); return(scoreCardRepository.GetFields().FirstOrDefault(x => x.Id == id)); }); }
public ScoreController(IScoreCardRepository scoreRepository) { _scoreRepository = scoreRepository; }