如何在Razor视图中使用using指令对类型进行别名?

Sha*_*eKm 11 asp.net-mvc namespaces razor asp.net-mvc-3

我需要使用using指令对类型进行别名,通常这样做:

using LocalResources = Resources.Admin.SomeResource;
Run Code Online (Sandbox Code Playgroud)

如何在Razor视图中执行此操作,以便我可以像使用它一样使用它@LocalResources.FirstName

Sur*_*mra 17

这是怎么回事

@using File = System.IO.File //at the top of the page then 
// use @File any where in the cshtml page.
Run Code Online (Sandbox Code Playgroud)