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)
精彩评论