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:
N. Taylor Mullen 2019-04-01 20:59:11 -07:00
parent ec503be2d5
commit b1aef03aaf
2 changed files with 2 additions and 2 deletions

View File

@ -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; }

View File

@ -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();