My migration code is still a spike, and has no tests. The controller-routing part works, and so does my views. They are WebForms, after all. But I have problems with the naming conventions, as ReSharper struggles with them. I don't know if that's a ReSharper bug or an inherent weakness in .NET.
The convention is to locate the view in a path like this: /views/controllername/viewname.aspx.
The problem arise when I have a controller an a model with similar name, like PlanController and Plan, and a view named like an existing class. The view to list plans would have a path like /Views/Plan/List.aspx.
You see how Visual Studio would create a WebForm class named List in a namespace named Views.Plan?
That creates some problems with ReSharper and .NET:
- The namespace name Plan shadows the model of the same name. ReSharper intellisense stops at the namespace and never suggests to use the model class.
- The compiler thinks I am using a namespace where a class is expected.
- The view name List shadows the generic List class. ReSharper intellisense doesn't recognize this, and never suggests to use use List
.
The namespace/model crash can be fixed by prefixing the model class, but I don't like to litter my code with Models.Plan or whatever the model-namespace would be.
No comments:
Post a Comment