예제 #1
0
        static void Main(string[] args)
        {
            Configuration programConfiguration;

            programConfiguration = ConfigurationMenager.ReadConfiguration();


            var optionsBuilder = new DbContextOptionsBuilder <TestAppContext>();

            optionsBuilder.UseSqlServer(programConfiguration.Connection.ConnectionString);

            using (var context = new TestAppContext(optionsBuilder.Options))
            {
                AuthorLoader authorLoader = new AuthorLoader(context);
                authorLoader.LoadMethod(programConfiguration.AuthorsPath);

                BookLoader bookLoader = new BookLoader(context);
                bookLoader.LoadMethod(authorLoader.authorsCount, programConfiguration.BooksPath);
            }
        }