Пример #1
0
        private static async Task RunDemo(IMovies repo)
        {
            try
            {
                DataSet dataSet   = new DataSet();
                var     jKRowling = dataSet.Persons["JKRowling"];
                await repo.InitialiseAsync();

                await repo.DropAllAsync();

                await repo.SaveAsync(dataSet.Movies["HarryPotterM1"]);

                await repo.SaveAsync(jKRowling);

                var movies = await repo.FindByWriter(jKRowling);

                foreach (var movie in movies)
                {
                    Console.WriteLine($"{jKRowling.Name} wrote: {movie.Title}.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }