title: C# OData set default properties returned by $select
body: <p>I'm doing a custom EnableQueryAttribute to block some properties from being queryable:</p>
  
  <pre><code>[EnableSpecificQueryable(AllowedSelectProperties = "Id, FirstName, LastName")]
  </code></pre>
  
  <p>It's working, but if no query is sent (only something like <a href="http://foo.bar/api/foo" rel="nofollow">http://foo.bar/api/foo</a>), ValidateQuery and ApplyQuery (see EnableQueryAttribute) are never called and the default behavior shows all Properties, what I don't want. How to manage this problem ? Where do I have to write the code for this situation ?</p>
  
  <p>After this, I have some questions about general design. IMO, View Model are really bad when it comes to maintain it. It has a lot of duplicate code and a lot of file for not that much.</p>
  
  <p><strong>1. What is the best way to limit what properties can be returned by an Action ?</strong></p>
  
  <p>I really love the idea to simply give a list of property name on each Action than using hundred of view models. Sadly this only apply to GET request and I would like to do the same for post and patch.</p>
  
  <p><strong>2. How can I apply the same design for POST/PUT/PATCH without using redundant code like View Model ?</strong></p>
  
  <p>The answer to this question needs to take into account specialized Data annotation for each Action (being able to override Model's data annotation and adding new validations).</p>
  
  <p>I'm working with OData in a Web APi project using Entity Framework Code First.</p>
  
  <p>Thank you!</p>