title: How to hide Entity Framework entity properties from strongly typed views?
body: <p>I am using Entity Framework in my ASP.NET MVC 4.0 application and I want to know how to prevent or hide fields from my entity from being generated in my strongly typed view? Right now several primary key fields and timestamp fields are being generated on the view which I do not want. </p>
  
  <p>I know setting the property to <code>internal</code> as opposed to <code>public</code> works but I am not sure of the total downstream effect this will have. I prefer to use data annotations on the properties but the ones I have tried prevent Controller scaffolding or make them as hidden fields. I prefer for them to remain public but just not be generated in the strongly typed view.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>To generate a strongly typed View, add a new 'View' in Visual Studio and select the class in the dialog to which the view is modeled after. This in turn will create a view with all of the controls that are represented by properties on the class. For example a <code>LastName</code> field is created as below:</p>
  
  <pre><code>@Html.EditorFor(model =&gt; model.FirstName)
  </code></pre>