From 3dfcc884fe4eefb38182871caa76df90317d9db3 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 9 Dec 2014 16:37:56 -0800 Subject: [PATCH] Changes to address IFileSystem.Watch method addition Absorbs the new IFileSystem interface. This change is to just address the breaking change introduced in IFileSystem. Razor has to do the necessary changes to subscribe to the Watch event for expiring the modified files. --- .../Compilation/DefaultRazorFileSystemCache.cs | 7 +++++++ test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileInfo.cs | 6 ------ .../Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileSystem.cs | 5 +++++ .../Compilation/DefaultRazorFileSystemCacheTest.cs | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/DefaultRazorFileSystemCache.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/DefaultRazorFileSystemCache.cs index 82dd51d9fd..b60d694078 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/DefaultRazorFileSystemCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/DefaultRazorFileSystemCache.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Concurrent; using Microsoft.AspNet.FileSystems; using Microsoft.Framework.OptionsModel; +using Microsoft.Framework.Expiration.Interfaces; namespace Microsoft.AspNet.Mvc.Razor { @@ -71,6 +72,12 @@ namespace Microsoft.AspNet.Mvc.Razor } } + /// + public IExpirationTrigger Watch(string filter) + { + return _fileSystem.Watch(filter); + } + private class ExpiringFileInfo { public IFileInfo FileInfo { get; set; } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileInfo.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileInfo.cs index 6941503f81..21e36ecde4 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileInfo.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileInfo.cs @@ -5,7 +5,6 @@ using System; using System.IO; using System.Text; using Microsoft.AspNet.FileSystems; -using Microsoft.Framework.Expiration.Interfaces; namespace Microsoft.AspNet.Mvc.Razor { @@ -61,10 +60,5 @@ namespace Microsoft.AspNet.Mvc.Razor { throw new NotSupportedException(); } - - public IExpirationTrigger CreateFileChangeTrigger() - { - throw new NotSupportedException(); - } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileSystem.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileSystem.cs index 3b7f2d1c7c..84dfc25b80 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileSystem.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFileSystem.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using Microsoft.AspNet.FileSystems; +using Microsoft.Framework.Expiration.Interfaces; namespace Microsoft.AspNet.Mvc.Razor { @@ -53,5 +54,9 @@ namespace Microsoft.AspNet.Mvc.Razor } } + public IExpirationTrigger Watch(string filter) + { + throw new NotImplementedException(); + } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/DefaultRazorFileSystemCacheTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/DefaultRazorFileSystemCacheTest.cs index f10ec52df3..3ff4f5ed29 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/DefaultRazorFileSystemCacheTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/Compilation/DefaultRazorFileSystemCacheTest.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.FileSystems; using Microsoft.Framework.OptionsModel; +using Microsoft.Framework.Expiration.Interfaces; using Moq; using Xunit; @@ -404,7 +405,7 @@ namespace Microsoft.AspNet.Mvc.Razor } } - public bool TryGetParentPath(string subpath, out string parentPath) + public IExpirationTrigger Watch(string filter) { throw new NotImplementedException(); }