Expand RazorProject.GetItem to take in FileKinds when getting items.
- Obsoleted old `GetItem` API.
- Updated tests to take new API.
- Added a new test to verify the broken scenario.
dotnet/aspnetcore-tooling#8972
\n\nCommit migrated from 2dd34b8dd8
This commit is contained in:
parent
ec503be2d5
commit
b1aef03aaf
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Razor.Performance
|
|||
|
||||
ProjectEngine = RazorProjectEngine.Create(RazorConfiguration.Default, fileSystem, b => RazorExtensions.Register(b)); ;
|
||||
|
||||
MSN = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"));
|
||||
MSN = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), FileKinds.Legacy);
|
||||
}
|
||||
|
||||
public RazorProjectEngine ProjectEngine { get; }
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Razor.Performance
|
|||
|
||||
ProjectEngine = RazorProjectEngine.Create(RazorConfiguration.Default, fileSystem, b => RazorExtensions.Register(b)); ;
|
||||
|
||||
var projectItem = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"));
|
||||
var projectItem = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), FileKinds.Legacy);
|
||||
MSN = RazorSourceDocument.ReadFrom(projectItem);
|
||||
|
||||
var directiveFeature = ProjectEngine.EngineFeatures.OfType<IRazorDirectiveFeature>().FirstOrDefault();
|
||||
|
|
|
|||
Loading…
Reference in New Issue