gpt4 book ai didi

asp.net-mvc - 如何在我的 Razor View 中使用 using 指令为类型别名?

转载 作者:行者123 更新时间:2023-12-04 01:43:13 26 4
gpt4 key购买 nike

我需要用 using 为类型别名指令,通常是这样完成的:

using LocalResources = Resources.Admin.SomeResource;

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

最佳答案

这是如何

@using File = System.IO.File //at the top of the page then 
// use @File any where in the cshtml page.

关于asp.net-mvc - 如何在我的 Razor View 中使用 using 指令为类型别名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4798293/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com