コード例 #1
0
        private static IApplicationBuilder EnsureAvailableDirectories(
            this IApplicationBuilder app,
            string webRootPath,
            string contentRootPath,
            BlobFolders blobFolders)
        {
            var publicFolderPath = Path.Combine(webRootPath, blobFolders.Public);

            CreateDirectoryIfNotExist(publicFolderPath);

            var privateFolderPath = Path.Combine(contentRootPath, blobFolders.Private);

            CreateDirectoryIfNotExist(privateFolderPath);

            var commonFolderPath = Path.Combine(webRootPath, blobFolders.Common);

            CreateDirectoryIfNotExist(commonFolderPath);

            return(app.InitDefaultBlob(new[]
            {
                BuildBlob(blobFolders.Public, publicFolderPath, blobFolders.Public),
                BuildBlob(blobFolders.Private, privateFolderPath),
                BuildBlob(blobFolders.Common, commonFolderPath, blobFolders.Common)
            }));
        }
コード例 #2
0
 public static IApplicationBuilder UseCustomStaticFiles(
     this IApplicationBuilder app,
     string webRootPath,
     string contentRootPath,
     BlobFolders blobFolders)
 => app
 .EnsureAvailableDirectories(webRootPath, contentRootPath, blobFolders)
 .UseStaticFiles();