Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:57:19+00:00 2026-05-24T11:57:19+00:00

I’m creating a website using Entity Framework (4.1), which exposes WCF services, and I

  • 0

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, without creating a proxy/wrapper etc. class. For example, I have a User 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 [Serializable] and [DataContract] attributes, with fields having the [DataMember] 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:57:20+00:00Added an answer on May 24, 2026 at 11:57 am

    To avoid the PROXY entites on the client, you can reuse the same entities (client and server side) by making sure that your client already references the server Entity assembly (assuming that you have mapped POCO’s in EF and separated them out into their own assembly). Then check the advanced options in the server reference and ensure “Reuse Types in referenced Assemblies” is checked.

    This will create a proxy Interface and client, but reuse the server Entities.

    You can avoid the proxied interface as well by using the ClientBase<> generic instead of the service reference, although you will now need to strip out your Service side Interfaces (Service Contract interfaces) into a separate assembly and reference this on both Client and Server.

    And as per your observation, if you don’t mark a Property on your Entity as [DataMember], it won’t be serialized. Since you’ve got the same entity both sides, fields like will come out as their default value (0, null etc) on the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.