ASP.NET MVC: using methods in an ViewModel -


it's anti-pattern make methods in viewmodel on asp.net mvc project?

for example, have field named "description" in viewmodel , string type. in view show first 40 caracteres of field. so, knowing view's rule, should do? format field in getter method in viewmodel or use htmlhelper this? or using razor?

thank's attention , apologize bad english...

if purely layout rule in view. if used in multiple views or don't having code in layout files create property in model substring value calculated .


Popular posts from this blog