예제 #1
0
        public static void Initialize(EbookShopContext context,
                                      string ebookImagesDirectory,
                                      string ebooksDirectory
                                      )
        {
            var initializer = new EbookShopInitializer();

            initializer.EbookImagesDirectory = ebookImagesDirectory;
            initializer.EbooksDirectory      = ebooksDirectory;
            initializer.SeedEverythink(context);
        }
예제 #2
0
        public static void Initialize(EbookShopContext context,
                                      IHostingEnvironment hostingEnvironment)
        {
            var root       = hostingEnvironment.WebRootPath;
            var imgStorage = Path.Combine(root, "images");
            var exists     = Directory.Exists(imgStorage);

            if (!exists)
            {
                Debug.Fail($"Directory {imgStorage} does not exists");
            }
            var relative    = "images";
            var initializer = new EbookShopInitializer();

            Initialize(context, relative, null);
        }