views:

50

answers:

1

I have my Model defined externally in two projects - a Core project and an Interface project.

I am opening the Add View dialogue from my controller, and selecting Create a strongly typed view.

In the drop down list, I can select the concrete types like MyProject.Model.Core.OrderDetails, but the interface types like MyProject.Model.Interface.IOrderDetails aren't there.

I can type the interface class in manually and everything works, but then the View content menu that lets you select the Create, Delete, List, etc scaffolding is disabled.

Is there some problem with using interfaces in MVC? Or is it something else I'm missing?

Edit: Just to clarify, if I select the concrete object and the whatever scaffolding I want, I can then edit the Inherits tag in the view Page directive and everything works fine, so there's no missing references or anything. It's just the wizard doesn't seem to want to work with the interface.

A: 

Well, you could always select the concrete class implementing the interface, generate the partial view, and manually remove all the stuff that's not needed.

Darin Dimitrov
That's what I'm doing at the moment. It's not really a problem, more something I found curious as if this is a known issue with MVC it's pretty lame. Isn't one of the main goals of MVC to promote loose coupling?
fearofawhackplanet