Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Closed Issue: Incorrect namespace for viewmodels [68]

$
0
0
I have a few cases where the viewmodel and a view has the same name (in different namespaces) like this:

MyProject.Models.ThankYou <- viewmodel
MyProject.Views.Signup.ThankYou <- razor view

The razor template has the usual "@model ThankYou" in the beginning, and this resolves to MyProject.Models.ThankYou but the generated.cs is

public class ThankYou: MyWebRole.Helpers.WebViewPage<ThankYou>

which means that the <ThankYou> refers to itself, not the viewmodel.

When I specify the full namespace and class it compiles wonderfully.

The quick fix I guess would be to specify the full namespace and class as Razor would interpret it, instead of just class in the generator?
Comments: Feel free to open if you think this still needs addressing. But there are workarounds for this that would work.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>