title: WCF, Entity Framework & Data Contracts
body: <p>Using VS 2008 &amp; .NET 3.5 SP1:</p>
  
  <p>I am using WCF to allow clients to connect to a service that reads and writes database entries using Entity Framework.  By default the entities that are generated automatically from the database have the DataContract attribute applied.</p>
  
  <p>Unfortunately many of the fields are exposed are not meant for consumption by the client (i.e. - records of who is accessing what data, etc.) and for security reasons I would rather keep them from being exposed.  Is there any way to avoid Entity Framework classes from being exposed in this manner?</p>
  
  <p><strong><em>Note</em></strong>: This is not a duplicate of <a href="https://stackoverflow.com/questions/543644/how-to-prevent-private-properties-in-net-entities-from-being-exposed-as-public-v">How to prevent private properties in .NET entities from being exposed as public via services?</a>.  In that question the user wishes to selectively display certain fields, whereas I would like the entity to not be exposed as a DataContract at all.</p>
  
  <p>Thanks in advance.</p>