Canalblog
Editer l'article Suivre ce blog Administration + Créer mon blog
Publicité
asp.net
Publicité
Archives
19 novembre 2009

WCF and LINQ to Entities exposed attributes issue

On my last project, I've been searching for a solution to hide some properties of my EF generated entities to my wcf services clients. The problem is that WCF exposes all the entities members, public, private, or internal.

In fact, all entities properties marked with [DataMember] attribute will be exposed to the WCF client.

The solution remains in removing the [DataMember] attribute on the unwanted properties. And to have a clean solution, the EF code genrator must be customized.

I found the way to customize Entity Framework code generator here:

http://visualstudiomagazine.com/articles/2008/09/01/customize-code-generation-in-ef.aspx?sc_lang=en 

Publicité
Publicité
Commentaires
Publicité