C# – MVC in C#: Model – Controller relationship


Normally I have one controller and one model. Is there a disgn-pattern to have 1 View with multiple Controllers and multiple Models. Where very controller can have multiple models, too?

Some links to related patterns would be nice.

Best Solution

Generally a controller has only one model. However, you could create a composite model that itself has multiple models.

class CompositeModel
 private ModelA modela;
 private ModelB modelb;

And then have your Controller typed to that.

But if you don't know what you're doing ultimately that's a plan that'll only end in tears.

But if you can manage to avoid the God Model pattern it can be very powerful.