What kind of data belongs in a view model?

Posted by Byron Sommardahl on Stack Overflow See other posts from Stack Overflow or by Byron Sommardahl
Published on 2010-05-04T18:45:46Z Indexed on 2010/05/04 18:48 UTC
Read the original article Hit count: 251

Filed under:
|

The name "view model" suggests that it models the data for the view. That much is obvious. What else can or should go in the view model?

As an example, a view might display a list of items in a shopping cart, fields for customer's credit card info, and fields for customer's billing information. The view model might contain properties for all that OR it might only contain properties for the shopping cart items.

© Stack Overflow or respective owner

Related posts about mvc

Related posts about viewmodel