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

  • SEARCH
  • Home
  • 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 6212835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:35:18+00:00 2026-05-24T06:35:18+00:00

I am trying to create WCF Data service project using Entity Framework. ( I

  • 0

I am trying to create WCF Data service project using Entity Framework. ( I am new to both).

I created entities using DB.
Now, I created service operation, which returns the IQueryable<entity>.

My problem is

  1. I do not want to return the entire set of columns in the entity. I cannot delete them from the entity as it is not null. How to avoid these?

  2. I have few FK columns and I need other column details of the table. How to include columns from other table?

  3. Why it is not possible to use POCO class to be returned from WCF Data service?

  4. How do I format the response; i.e., add few more details to the response like page number etc, change the xml tags, remove few details like “link rel”?

I have tried a lot of things to achieve 1 and 2. But finally I realised that I can only use the entity as it is to make it work.

I have no idea about 4.

Any suggestions would be appreciated.

  • 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-24T06:35:18+00:00Added an answer on May 24, 2026 at 6:35 am

    1. I do not want to return the entire set of columns in the entity.
    2. I have few FK columns and I need other column details of the
    table.

    For this, you should define a new class that matches what you need / what you want your clients to see. That can be a straight POCO class – no special requirements. Assemble that class for each entity, leaving out the unwanted columns, and grabbing the extra field or two for the FK columns into that new class. Return an IQueryable<YourNewClass> instead of the entity class directly.

    To avoid huge left-right-assignment statements just to fill the properties of the new class, you should have a look at AutoMapper which makes it really easy to copy around classes that are very similar to one another (e.g. missing or adding a few properties).

    4. How do I format the response; i.e., add few more details to the
    response like page number etc, change the xml tags, remove few details
    like “link rel”?

    That’s not possible – the OData protocol very strictly defines what’s going to be in the message, what links there are etc. If you can’t live with that – you’ll have to roll your own WCF REST service and drop the WCF Data Service stuff altogether.

    Check out the WCF REST Developer Center on MSDN if you want to investigate that route more thoroughly.

    Update: that link seems to have gone dead – try WCF Web Http Programming Overview instead.

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

Sidebar

Related Questions

I am trying to create a WCF Data Service that returns objects that look
I am trying to create a logging service using WCF Rest. It looks something
Trying to create an framework 4.0 WCF basicHttp service hosted by IIS (6) that
I am trying to create a completely dynamic way to query entity framework using
Im trying to create a WCF-service to hold generic data for a bunch of
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I am trying to create a common service library shared between a WCF web
We are trying to create a proxy class that would serve the WCF service
I'm trying to use WCF Data Service with Subsonic, but ran into this error
I am trying to create a WCF Streaming Service. I have two requirements that

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.