title: ViewModel Best Practices
body: <p>From <a href="https://stackoverflow.com/questions/526641/what-to-put-in-your-viewmodel">this question</a>, it looks like it makes sense to have a controller create a <strong>ViewModel</strong> that more accurately reflects the model that the view is trying to display, but I'm curious about some of the conventions (I'm new to the MVC pattern, if it wasn't already obvious).</p>
  
  <p>Basically, I had the following questions:</p>
  
  <ol>
  <li>I normally like to have one class/file.  Does this make sense with a <strong>ViewModel</strong> if it is only being created to hand off data from a controller to a view?</li>
  <li>If a <strong>ViewModel</strong> does belong in its own file, and you're using a directory/project structure to keep things separate, where does the <strong>ViewModel</strong> file belong?  In the <strong>Controllers</strong> directory?</li>
  </ol>
  
  <p>That's basically it for now.  I might have a few more questions coming up, but this has been bothering me for the last hour or so, and I can seem to find consistent guidance elsewhere.</p>
  
  <p><strong>EDIT:</strong>
  Looking at the sample <a href="http://nerddinner.codeplex.com/" rel="noreferrer">NerdDinner app</a> on CodePlex, it looks like the ViewModels are part of the <a href="http://nerddinner.codeplex.com/SourceControl/changeset/view/18010#439996" rel="noreferrer">Controllers</a>, but it still makes me uncomfortable that they aren't in their own files.</p>