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

The Archive Base Latest Questions

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

I have a project I am working on that has a Order entity that

  • 0

I have a project I am working on that has a Order entity that has a navigation property for OrderITems:

public class Order
{
   public int OrderId { get; set; }
   public int CustomerId { get; set; }

   public virtual ICollection<OrderItem> OrderItems { get; set; }
}

public class OrderItem
{
   public int OrderId { get; set; }
   public int ProductId { get; set; }
   public int Quantity { get; set; }

   public virtual Order Order { get; set; }
}

If I query the OrderItems like so:

http://mysvc.com/mysvc/OrderItems?$expand=Order&$filter=ProductId eq 1234

It works well but I ultimately need to bind to the Order only. So, I would like to project like this:

http://mysvc.com/mysvc/OrderItems?$expand=Order&$filter=ProductId eq 1234&$select=Order

However, I receive a ‘Not Implemented’ exception.

Th project is using an EntityFramework code first 4.1 data provider and all of the wiring “appears” correct. The only thing extra I added was routing to produce the clean restful uris and support for the $format option via a IDispatchMessageInspector.

Ok, Thanks to Vitek’s input I was able to get a more complete exception:

<error>
    <code/>
    <message xml:lang="en-US">Not Implemented</message>
    <innererror>
        <message>Unable to create a constant value of type 'System.Data.Services.Internal.ProjectedWrapper1'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.
        </message>
        <type>System.NotSupportedException</type>
        <stacktrace>   at System.Data.Objects.ELinq.ExpressionConverter.ConstantTranslator.TypedTranslate(ExpressionConverter parent, ConstantExpression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.ConditionalTranslator.TypedTranslate(ExpressionConverter parent, ConditionalExpression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input)

           at System.Data.Objects.ELinq.ExpressionConverter.TranslateLambda(LambdaExpression lambda, DbExpression input, DbExpressionBinding& binding)

           at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.OneLambdaTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, DbExpression& source, DbExpressionBinding& sourceBinding, DbExpression& lambda)

           at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SelectTranslator.Translate(ExpressionConverter parent, MethodCallExpression call)

           at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.SequenceMethodTranslator.Translate(ExpressionConverter parent, MethodCallExpression call, SequenceMethod sequenceMethod)

           at System.Data.Objects.ELinq.ExpressionConverter.MethodCallTranslator.TypedTranslate(ExpressionConverter parent, MethodCallExpression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TypedTranslator`1.Translate(ExpressionConverter parent, Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression(Expression linq)

           at System.Data.Objects.ELinq.ExpressionConverter.Convert()

           at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)

           at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)

           at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()

           at System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator()

           at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.IEnumerable.GetEnumerator()

           at System.Data.Services.Internal.ProjectedWrapper.EnumerableWrapper.System.Collections.IEnumerable.GetEnumerator()

           at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)
           </stacktrace>
    </innererror>
</error>
  • 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-28T11:19:13+00:00Added an answer on May 28, 2026 at 11:19 am

    If this is using EF Code First it needs to define the service as DataService and override the CreateDataSource to use the trick described in this article in section #5: http://social.technet.microsoft.com/wiki/contents/articles/5234.aspx

    Otherwise WCF DS treats the DbContext as a reflection provider would and runs queries intended for LINQ to Objects. This mostly works, but for more complicated queries it sometimes breaks. If the WCF DS knows it runs agains EF, it creates queries for EF which will work always.

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

Sidebar

Related Questions

I have a project I am working on that has a Order entity that
I have been working on a project that has 2 interfaces - windows forms
The project I am working on has a rich text box that can have
I'm working on a project that has components, components have features, features have bugs.
I have this project that I'm working on for a class, and I'm not
I have project that I'm working on that is going to require a webserver.
I have a project I'm working on that requires our WPF application read SMS
I have a project that I'm currently working on but it currently only supports
I have a project that I'm working on and I need to be able
I have a project that I have been working on for a while, just

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.