title: Straightforward way to send Entities over WCF
body: <p>I'm creating a website using Entity Framework (4.1), which exposes WCF services, and I have a Silverlight client communicating with the server over WCF. I want to send (and possibly receive) some Entities over the WCF service, <strong>without</strong> creating a proxy/wrapper etc. class. For example, I have a <code>User</code> entity type with Username, Password, Email fields (actually many more but shortened just to keep this simple) and I want to send this object to the Silverlight client. While sending Username and Email, I (obviously) don't want to send the Password property to the client. Now, I'm writing a wrapper with attribute <code>[Serializable]</code> and <code>[DataContract]</code> attributes, with fields having the <code>[DataMember]</code> attribute, which includes the fields only that I need, create a new instance, copy the values from the entity object, and send that proxy object. It works, but it's inconvenient and extremely painful. What I need is a mechanism where I can directly set the properties I want to be sent, and simply don't expose anything else. I can't change the code of the entity model (to add/edit attributes) as it gets auto-regenerated each time I touch the EDMX. Is there a way to accomplish exposing only the selected members to the clients?</p>