0
我在不同类的两个方法之间有一个模棱两可的引用。C#[使用]作为数据注释
这个类在共享相同的结构就像不同的命名空间:
MyApp.Models.Folder1.Class1
MyApp.Models.Folder2.Class2
为什么我不能这样使用?
using MyApp.Models;
//and use this static method
Folder1.Class1.StaticMethod();
有没有什么办法只为一个方法使用命名空间?像:
[using(MyApp.Models.Folder1)]
public ContentResult SomeGetMethod(){
if(Class1.StaticBooleanMethod()) return "nice baby!";
return "that was horrible!";
}
绝对是对我的作品的感谢。 – 2015-02-09 00:04:03