Example #1
0
        public static void Main(string[] args)
        {
            var context = new CinemaContext();

            Mapper.Initialize(config => config.AddProfile <CinemaProfile>());

            ResetDatabase(context, shouldDropDatabase: false);

            var projectDir = GetProjectDirectory();

            //ImportEntities(context, projectDir + @"Datasets/", projectDir + @"ImportResults/");

            ExportEntities(context, projectDir + @"ExportResults/");

            //using (var transaction = context.Database.BeginTransaction())
            //{
            //    transaction.Rollback();
            //}
        }
Example #2
0
        private static void ImportEntities(CinemaContext context, string baseDir, string exportDir)
        {
            var movies =
                DataProcessor.Deserializer.ImportMovies(context,
                                                        File.ReadAllText(baseDir + "movies.json"));

            PrintAndExportEntityToFile(movies, exportDir + "Actual Result - ImportMovies.txt");

            var projections = DataProcessor.Deserializer.ImportProjections(context,
                                                                           File.ReadAllText(baseDir + "projections.xml"));

            PrintAndExportEntityToFile(projections, exportDir + "Actual Result - ImportProjections.txt");

            var customerTickets =
                DataProcessor.Deserializer.ImportCustomerTickets(context,
                                                                 File.ReadAllText(baseDir + "customers-tickets.xml"));

            PrintAndExportEntityToFile(customerTickets, exportDir + "Actual Result - ImportCustomerTickets.txt");
        }
        public static void Main(string[] args)
        {
            var context = new CinemaContext();

            Mapper.Initialize(x =>
            {
                x.AddProfile <CinemaProfile>();
            });

            var file =
                File.ReadAllText(@"D:\GitHub Local\SoftUni-Software-Engineering\C# DB\Entity Framework Core\Exams\Databases Advanced Exam – 7 April 2019\Cinema\Cinema\Datasets\projections.xml");

            Console.WriteLine(Serializer.ExportTopCustomers(context, 16));

            using (var transaction = context.Database.BeginTransaction())
            {
                transaction.Rollback();
            }
        }
Example #4
0
        public static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            var context = new CinemaContext();

            Mapper.Initialize(config => config.AddProfile <CinemaProfile>());

            //ResetDatabase(context, shouldDropDatabase: true);

            var projectDir = GetProjectDirectory();

            //ImportEntities(context, projectDir + @"Datasets/", projectDir + @"ImportResults/");

            ExportEntities(context, projectDir + @"ExportResults/");

            using (var transaction = context.Database.BeginTransaction())
            {
                transaction.Rollback();
            }
        }
Example #5
0
        public static void Main(string[] args)
        {
            var context = new CinemaContext();

            //var movie = context.Projections.FirstOrDefault(x => x.Movie.Title == "SIS");
            //string title = movie.Movie.Title;

            Mapper.Initialize(config => config.AddProfile <CinemaProfile>());

            ResetDatabase(context, shouldDropDatabase: true);

            var projectDir = GetProjectDirectory();

            ImportEntities(context, projectDir + @"Datasets/", projectDir + @"ImportResults/");

            ExportEntities(context, projectDir + @"ExportResults/");

            using (var transaction = context.Database.BeginTransaction())
            {
                transaction.Rollback();
            }
        }
 public static void Main(string[] args)
 {
     using var context = new CinemaContext();
 }