How to expose part of Entity as DataContract?
Up to now, when working with WCF, I have always been exposing the whole either EF generated entities, or POCOs(by modifying the T4 template to include DataContract and DataMember on POCOs and properties) as DataContract. Now, I have come across a situation that I cannot expose the whole thing, and need to explicitly specify my DataContract to be a subset of the entities. It worth saying that one of my entities is something like below: And I want to just expose Id, Name, CategoryId, Price. Insert/Update of rest of the fields ( ActiveFrom , InactiveDate , Supported ) is something that will be