When is it right to use ViewData instead of ViewModels?

后端 未结 4 1344
死守一世寂寞
死守一世寂寞 2021-01-11 18:28

Assuming you wanted to develop your Controllers so that you use a ViewModel to contain data for the Views you render, should all data be contained within the ViewMo

4条回答
  •  借酒劲吻你
    2021-01-11 19:05

    I personally never use ViewData, everything goes through the Model, except when im testing something and i quickly need to be able to see the value on the view. Strongtyping!

提交回复
热议问题