0

A while back I had posted this question about the use of ViewModels.

I have another question related to the same topic -

Is it ok to create a generic viewmodel? By generic, I mean a viewmodel that can be shared among different views. (some views may use one subset of the fields of the viewmodel while another may use another subset). Or should each viewmodel be tailor made for one specific view?

Community
  • 1
  • 1
mridula
  • 3,203
  • 3
  • 32
  • 55

2 Answers2

0

Well the short answer is Yes and the long answer is Yes.

Paging for instance if configured via your ViewModels is a good reason to generalize your ViewModel for those pages. That's only one example but i'm sure there's gonna be more....

Quinton Bernhardt
  • 4,773
  • 19
  • 28
0

Why not use the ViewBag?

This is what it's meant to be used for, in my experience.

Neil M.
  • 456
  • 5
  • 16