title: ASP.NET MVC: having one model for all views
body: <p>I like the way model binding in django works: you send stuff that you need in a Json-like way:</p>
  
  <pre><code>'param1': val,
  'param2': val
  </code></pre>
  
  <p>In ASP.NET MVC you can't do it primarily because C# is a static language. You <em>can</em> use <code>ViewData</code> but it's ugly and not recommended.</p>
  
  <p>So I had to create dozens of ViewModels for every view: IndexViewModel, AboutViewModel, etc. And today I got an idea: why not just create one <code>Model</code> class and have Visual Studio generate all necessary fields? It's almost like in django.</p>
  
  <pre><code>return View(new Model
              {
                  Param1 = "asd",
                  Param2 = "sdf"
              });
  </code></pre>
  
  <p>Param1 &amp; Param2 are not members of the Model class, but Visual Studio will automatically generate them.</p>
  
  <p>Now my question is, is it gonna work? The thing is that there will be a lot of fields in this Model class. And when we pass it to a view, only a small percentage of fields made for that view in particular will be used. Is it gonna be bad performance wise? </p>
  
  <p>Thanks</p>