让RazorLight支持DateTime等System中的基础方法
SharkLock opened this issue · 2 comments
#387 这个问题我也遇到了, 不过我用的是DateTime的对象同样提示
Failed to compile generated Razor template:
(3:17) The name 'DateTime' does not exist in the current context
See CompilationErrors for detailed information
Describe the solution you'd like
在这个文件中
D:\RazorLight\src\RazorLight\Generation\RazorSourceGenerator.cs
在internal protected RazorSourceDocument GetNamespacesImports()增加对Namespaces的非空判断
在public virtual async Task<IEnumerable> GetImportsAsync(RazorLightProjectItem projectItem)
中调整 TextSourceRazorProjectItem的返回值 变更后的代码如 下面两张图
@SharkLock
you may want to translate your message to English for better comprehension of everyone on Github.
We could all everyone open the translator, or you could do it once, thus you will help everyone once for all
Closing, as I have no idea what this is all about ¯_(ツ)_/¯