Changed on virtual file provider.

pull/179/head
Halil İbrahim Kalkan 8 years ago
parent 0339d9361f
commit 5228cf9aa9

@ -36,7 +36,7 @@ namespace AbpDesk.Blogging
options.FileSets.Add(
new EmbeddedFileSet(
"/",
"/wwwroot/",
GetType().Assembly,
"wwwroot" //TODO: This is not tested yet!
)

@ -37,7 +37,7 @@ namespace Volo.Abp.Account.Web
options.FileSets.Add(
new EmbeddedFileSet(
"/",
"/wwwroot/",
GetType().GetTypeInfo().Assembly,
"Volo.Abp.Account.Web.wwwroot"
)

@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Builder
new StaticFileOptions
{
FileProvider = new AspNetCoreVirtualFileProvider(
app.ApplicationServices
app.ApplicationServices,
"/wwwroot"
)
}
);

@ -19,7 +19,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
{
options.FileSets.Add(
new EmbeddedFileSet(
"/",
"/wwwroot/",
GetType().GetTypeInfo().Assembly,
"Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.wwwroot"
)

@ -14,7 +14,7 @@
<vc:abp-style-bundle name="GlobalStyles"></vc:abp-style-bundle>
<link rel="stylesheet" type="text/css" href="~/Views/Shared/_AppLayout.css"/>
<link rel="stylesheet" type="text/css" href="~/views/shared/_AppLayout.css"/>
@RenderSection("styles", false)
</head>

@ -12,7 +12,7 @@
<ItemGroup>
<EmbeddedResource Include="Views\Shared\Components\AbpMenu\Default.cshtml" />
<EmbeddedResource Include="Views\Shared\_AppLayout.cshtml" />
<EmbeddedResource Include="Views\Shared\_AppLayout.css" />
<EmbeddedResource Include="wwwroot\views\shared\_AppLayout.css" />
<EmbeddedResource Include="Views\Shared\_ViewImports.cshtml" />
<EmbeddedResource Include="wwwroot\libs\bootstrap\css\bootstrap.css" />
<EmbeddedResource Include="wwwroot\libs\bootstrap\css\bootstrap.css.map" />

@ -27,7 +27,7 @@ namespace Volo.Abp.AspNetCore.Mvc
options.FileSets.Add(
new EmbeddedFileSet(
"/",
"/wwwroot/",
GetType().GetTypeInfo().Assembly,
"Volo.Abp.AspNetCore.Mvc.wwwroot"
)

@ -1,4 +1,5 @@
using System;
using System.IO;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;
@ -13,11 +14,12 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem
private readonly Lazy<IVirtualFileProvider> _virtualFileProvider;
private readonly Lazy<AspNetCoreVirtualFileOptions> _options;
private readonly IObjectAccessor<IServiceProvider> _serviceProviderAccessor;
private readonly string _contentPath;
public AspNetCoreVirtualFileProvider(IServiceProvider serviceProvider)
public AspNetCoreVirtualFileProvider(IServiceProvider serviceProvider, string contentPath = null)
: this(new ObjectAccessor<IServiceProvider>(serviceProvider))
{
_contentPath = contentPath;
}
public AspNetCoreVirtualFileProvider(IObjectAccessor<IServiceProvider> serviceProviderAccessor)
@ -37,6 +39,11 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem
public IFileInfo GetFileInfo(string subpath)
{
if (_contentPath != null)
{
subpath = _contentPath + subpath;
}
//TODO: Ignore files in _options.Value.IgnoredFileExtensions
if (!IsInitialized())
@ -49,6 +56,11 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem
public IDirectoryContents GetDirectoryContents(string subpath)
{
if (_contentPath != null)
{
subpath = _contentPath + subpath;
}
//TODO: Ignore files in _options.Value.IgnoredFileExtensions
if (!IsInitialized())

@ -43,7 +43,7 @@ namespace Volo.Abp.Identity.Web
options.FileSets.Add(
new EmbeddedFileSet(
"/",
"/wwwroot/",
GetType().Assembly,
"Volo.Abp.Identity.Web.wwwroot"
)

Loading…
Cancel
Save