Asp .Net MVC Viewmodel should be class or struct?

Posted by Jonas Everest on Stack Overflow See other posts from Stack Overflow or by Jonas Everest
Published on 2011-01-17T03:41:44Z Indexed on 2011/01/17 3:53 UTC
Read the original article Hit count: 282

Filed under:
|
|

Hey guys,

I have just been thinking about the concept of view model object we create in asp.net MVC. Our purpose is to instantiate it and pass it from controller to view and view read it and display the data.

Those view model are usually instantiated through constructor. We won't need to initialize the members, we may not need to redefine/override parameterless constructor and we don't need inheritance feature there.

So, why don't we use struct type for our view model instead of class. It will enhance the performance.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc