[英]ASP.NET MVC Custom User class is clashing with System.Security.Principal.iPrinciapl
Hey guys I declared my own class User, and when I want to use it, I Include it's namesapce MyProj.Models; 嘿伙计们,我宣布自己的班级用户,当我想使用它时,我包括它的名字Myapj.Models;
But The System.Web.Security.Principal.iPrinciapl (Controller.User) is getting in the way and making me have to write out the whole path to my class if I want to use it. 但System.Web.Security.Principal.iPrinciapl(Controller.User)正在阻碍我,如果我想使用它,我必须写出我班级的整个路径。 IE MyProj.Models.User.DoSomething().
IE MyProj.Models.User.DoSomething()。
How can I get around this? 我怎么能绕过这个? Give mine priority or similar?
给我的优先级或类似?
The way I resolve this is to use a using alias: 解决这个问题的方法是使用using别名:
using mUser = MyProj.name.space.User;
public class MyController : Controller {
public void foo() {
var user = new mUser(...);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.