Beispiel #1
0
        public Task <Movie> GetById(int id, bool loadGraph = false)
        {
            var movie = InMemoryData.Movies.SingleOrDefault(m => m.Id == id);

            if (loadGraph)
            {
                movie.Principals = queryService.GetPrincipalsByMovie(id).Result;
            }
            return(Task.FromResult(movie));
        }
Beispiel #2
0
        public async Task <Movie> GetById(int id, bool loadGraph = false)
        {
            Movie movie = null;

            movie = db.Movies.FindAsync(id).Result;
            if (loadGraph)
            {
                movie.Principals = queryService.GetPrincipalsByMovie(id).Result;
            }
            return(await Task.FromResult(movie));
        }