0

Sample:

I have two classes

X and Y:X

I have two controller

XController and YController:XController

public class XController:Controller
{
    public virtual PartialViewResult Detail(X model)
    {
    }
} 

But I could not override Detail method because of different signature.

I have RenderAction(p=>p.Detail(y)) code in 7 places in other views. When I override Detail method in YController everything must be ok.

Do I have to write CustomControllerResolver?

Display template not used for interface

Solution above is not enough for me. Because I dont want to change anything else. Only I override Detail Action on YController.

I can make it with a little DRY. How can I call View from another area in Action ? Like

return View("AnotherArea.Detail",model);
Community
  • 1
  • 1
Oguz Karadenizli
  • 3,449
  • 6
  • 38
  • 73
  • 2
    What exactly are you trying to accomplish? Perhaps provide some context. – Marko May 24 '12 at 01:43
  • I want to write Wordpress in Asp.Net Mvc. Do you know it? – Oguz Karadenizli May 24 '12 at 01:47
  • @OğuzKaradenizli I think Marko was looking for what you are trying to accomplish with the inheritance – kenny May 24 '12 at 01:56
  • Every model is inherited from X Object. XController has main actions(views). So I want to user XController's actions for all controllers. When I want to specific action(view) for one model I will override it. – Oguz Karadenizli May 24 '12 at 02:27

0 Answers0