开发者

Why can't I have a folder named the same as a LINQ to SQL class

I'm using the LINQ to SQL dbml with a table/class named Category. If I make a folder in the project named Category I can no longer refere开发者_如何转开发nce the table Category in my code. Why is this.


Because adding the folder creates a namespace with it. ie. MyProject.Category will then refer the the linq to sql class as well as the namespace of your new folder.

This is probably bad practive to have a class and namespace called the same thing (especially if they are both in the same parent namespace)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜