From 9f2ce2007145d93f4a20046e86eb9e3d3b787d69 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Fri, 23 Sep 2016 12:32:17 +0200 Subject: [PATCH] fixes avatar commit --- .../ApplicationDbContextModelSnapshot.cs | 2 ++ Yavsc/Startup/Startup.FileServer.cs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 5ae62712..498caf50 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -149,6 +149,8 @@ namespace Yavsc.Migrations b.Property("AccessFailedCount"); + b.Property("Avatar"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken(); diff --git a/Yavsc/Startup/Startup.FileServer.cs b/Yavsc/Startup/Startup.FileServer.cs index f40ae025..2f66ed44 100644 --- a/Yavsc/Startup/Startup.FileServer.cs +++ b/Yavsc/Startup/Startup.FileServer.cs @@ -11,26 +11,24 @@ namespace Yavsc public partial class Startup { public static string UserFilesDirName { get; private set; } + public static FileServerOptions UserFilesOptions { get; private set; } public void ConfigureFileServerApp(IApplicationBuilder app, SiteSettings siteSettings, IHostingEnvironment env) { - var rootPath = Path.Combine( + UserFilesDirName = Path.Combine( env.WebRootPath, - // TODO: add a ressource serveur id here, - // or remove the blog entry id usage, to use the userid instead - // and an user defined optional subdir. - siteSettings.UserFiles.DirName - ); - var rootInfo = new DirectoryInfo(rootPath); + siteSettings.UserFiles.DirName); + + var rootInfo = new DirectoryInfo(UserFilesDirName); if (!rootInfo.Exists) rootInfo.Create(); - - app.UseFileServer(new FileServerOptions() + UserFilesOptions = new FileServerOptions() { - FileProvider = new PhysicalFileProvider(rootPath), + FileProvider = new PhysicalFileProvider(UserFilesDirName), RequestPath = new PathString("/" + siteSettings.UserFiles.DirName), EnableDirectoryBrowsing = env.IsDevelopment() - }); + }; + app.UseFileServer(UserFilesOptions); app.UseStaticFiles(); } }