views:

18

answers:

1

how do people deal with extra data needed to render a list.

eg I have a IList<User> Users that is a property on my viewmodel. However for each row in the user table, extra information needs to be displayed.

should i create a display model for User with the other properties included on it?

any ideas would be greatly appreciated?

+1  A: 

If you require a model just for dealing with presentation - ie. a view model - then yes, in my experience, it should reflect the needs of the view and can, and probably will diverge from the POCO User model you pass around elsewhere in your code.

From the sounds of it you are trying to have a 'dumb' view that will simply assign the values passed to it and contain no business logic; that's a good thing, and view models, in my experience, really help this process - all the complication of building up the model is pushed back into your controller/presenter/repository or whatever.

mlennox