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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:11:08+00:00 2026-05-28T07:11:08+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; }
}

I would like to be able to query the Orders with a filter against the collection of OrderItems

ex:
http:\mysvc.com\mysvc\Orders?$filter=OrderItems\ProductId eq 1234

However, I cannot seem to get this to work. Any ideas? I’d be happy to provide more details.

Project is using an EntityFramework code first 4.1 data provider.

Updated with exception and callstack:

Not Implemented 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.System.NotSupportedException   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.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)
    
  • 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-28T07:11:09+00:00Added an answer on May 28, 2026 at 7:11 am

    With the currently released bits you would have to turn the query around:

    /OrderItems?$expand=Order&$filter=ProductId eq 1234

    The downside to this approach is that if a single order has two OrderItems with the filtered product ID you will get the same order twice. Also you will get all the filtered OrderItems. You might use $select to scope down the amount of data downloaded.

    In the latest CTP (http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx) there’s a support for any/all, which is what you would use here. See this blog post for details http://www.odata.org/blog/even-more-any-and-all.

    • 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.