-
Notifications
You must be signed in to change notification settings - Fork 2.1k
* Introduce _GlobalImports to inherit directives. #2020
Conversation
namespace Microsoft.AspNet.Mvc.Razor | ||
{ | ||
/// <summary> | ||
/// Contains methods to locate <c>_ViewStart.cshtml</c> and <c>_Global.cshtml</c> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_GlobalImpot.cshtml
Pretty much there, ⌚ |
* Remove inheritance from _ViewStarts Fixes #825
af92ca1
to
25ad56d
Compare
25ad56d
to
e8a5ce1
Compare
Updated. |
@@ -126,20 +124,33 @@ public class PrecompilationTest | |||
Assert.NotEqual(response6.Layout, response7.Layout); | |||
|
|||
// Act - 8 | |||
// Refetch and verify we get cached types | |||
// Remove new _ViewStart file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lies
Looks good to me |
Just for anyone that's come across this thread or #881, the new way is to have a file called: _GlobalImport.cshtml (no 's' on the end) to 'globally' inject services into views which can exist at any view folder hierarchy or so it seems. |
To add to what @Shazwazza wrote above - this also seems to support the @inherits directive. So, you can derive your views from a base class globally without having to put @inherits at the top of each view. |
Fixes #825