public MoviesMutation(IMovieStore moviesStore) { Name = "Mutation"; Field <MovieType, Movie>() .Name("createMovie") .Argument <NonNullGraphType <MovieCreateInputType> >("movie", null) .ResolveAsync(async ctx => { var movieInput = ctx.GetArgument <Movie>("movie"); return(await moviesStore.CreateAsync(movieInput)); }); }
public DirectorType(IMovieStore movieStore, IDataLoaderContextAccessor accessor) { Field(x => x.Id); Field(x => x.Name); Field(x => x.BirthDate); Field <ListGraphType <MovieType> >() .Name("movies") .ResolveAsync(async ctx => { var loader = accessor.Context.GetOrAddBatchLoader <int, IEnumerable <Movie> >( "GetMoviesDirectedByAsync", movieStore.GetMoviesDirectedByAsync ); return(await loader.LoadAsync(ctx.Source.Id)); }); }
public MoviesQuery(IMovieStore movieStore) { Name = "Query"; Field <ListGraphType <MovieType> >() .Name("movies") .ResolveAsync(async ctx => { return(await movieStore.GetMoviesAsync()); }); Field <MovieType>() .Name("movie") .Argument <IntGraphType, int>("id", null) .ResolveAsync(async ctx => { return(await movieStore.GetMovieByIdAsync(ctx.GetArgument <int>("id"))); }); }
public MovieController() { _movieStore = new InMemoryMovieStore(); }
public MovieService(IMovieStore movieStore) { _movieStore = movieStore ?? throw new ArgumentNullException(nameof(movieStore)); }
public HomeController(IMovieStore movieStore) { _movieStore = movieStore; }
public MovieService() { MovieStore = StoreFactory.GetMovieStore(); }
public MovieService(FilmingLocationService filmingLocationService, ISearchService searchService, IMovieStore movieStore) { this.filmingLocationService = filmingLocationService; this.searchService = searchService; this.movieStore = movieStore; }
public MoviesController(IMovieStore store, MovieList list) { _store = store; }
public MoviesController(IMovieStore store) { _store = store; }
public MoviesController() { _store = new DatastoreMovieStore("assig1hao"); _imageUploader = new ImageUploader("book_hao"); }