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 9227779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:09:48+00:00 2026-06-18T05:09:48+00:00

I am using an Entity Framework-provided WCF DataService to expose an OData endpoint. I

  • 0

I am using an Entity Framework-provided WCF DataService to expose an OData endpoint. I want to create a Service Operation that returns a new type. But I get:

The exception message is ‘Unable to load metadata for return type ‘System.Linq.IQueryable1[MyNamespace+MyNewType]' of method 'System.Linq.IQueryable1[MyNamespace+MyNewType] FlightHours()’.’. See server logs for more details.

How can I let the DataService know I want it to grok MyNewType? Do I have to hackily make a fake entity on the EF DataContext, or can I simply “add” it in somehow? This post came up with that hack but I was hoping things had changed or that they missed something.

Update with relevant links:

  • I assume WCF DataService with Entity Framework: TimeSpan support would be solved the same way.
  • This MSDN discussion implies that methods like this exist for Reflection and Custom sources but make no mention of EF.
  • Jun 2013 update: Thanks to @dgorissen who found this possible counterexample: WCF Data Services 5.0 Workaround for returning POCOs? I haven’t had a chance to test this myself, and I don’t know why it would work, but maybe it will…
  • 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-06-18T05:09:50+00:00Added an answer on June 18, 2026 at 5:09 am

    There’s currently no other way than to teach the EF that such a type exists. When you use the EF provider for WCF DS, the entire metadata comes solely from EF, WCF DS doesn’t modify it in any (meaningful) way.

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

Sidebar

Related Questions

How to dispose objects in a Singleton WCF service? I am using Entity Framework
(USING ENTITY FRAMEWORK 4.3 CODE FIRST) The code is below. I want to actually
When using Entity Framework Code First 4.3.1 it is possible to create relationships with
I have a WCF service that is using a custom UsernamePasswordValidator. The validator needs
I use an Entity Framework (edmx file) for my model, and I'm using WCF
Using MySQl 5.5.19, entity framework 4.3, and have tried both the Sun-provided MySQL connector
I'm trying to use LINQPad with my MVC3 project that is using Entity Framework
(using Entity Framework) when i write : IEnumerable<string> q = customers /*EF entity*/ .Select
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc
When using Entity Framework 4.1, are there alternatives to the naming conventions for Navigation

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.