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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:45:17+00:00 2026-06-11T16:45:17+00:00

Why does the following code of my entity Person generates an error in my

  • 0

Why does the following code of my entity “Person” generates an error in my WCF Data Service:

[System.Data.Services.Common.DataServiceKey("PartitionKey", "RowKey")]
public class Person : TableServiceEntity
{
    public string Name { get; set; }
    public int Age { get; set; }
    ... etc

Error:

Request Error

The server encountered an error processing the request. The exception
message is ‘On data context type ‘PersonDataServiceContext’, there is
a top IQueryable property ‘Person’ whose element type is not an entity
type. Make sure that the IQueryable property is of entity type or
specify the IgnoreProperties attribute on the data context type to
ignore this property.’. See server logs for more details. The
exception stack trace is:

at
System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadata(IDictionary2
knownTypes, IDictionary
2 childTypes, IDictionary2 entitySets) at
System.Data.Services.Providers.BaseServiceProvider.LoadMetadata() at
System.Data.Services.DataService
1.CreateMetadataAndQueryProviders(IDataServiceMetadataProvider&
metadataProviderInstance, IDataServiceQueryProvider&
queryProviderInstance, BaseServiceProvider& builtInProvider, Object&
dataSourceInstance) at
System.Data.Services.DataService1.CreateProvider() at
System.Data.Services.DataService
1.HandleRequest() at
System.Data.Services.DataService`1.ProcessRequestForMessage(Stream
messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] ,
Object[] ) at
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object
instance, Object[] inputs, Object[]& outputs) at
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&
rpc) at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&
rpc) at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&
rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean
isOperationContextSet)

What am I doing wrong?
If I add a property called PersonID, the error is gone, but I need to access my entity through the PartitionKey and RowKey, and the DataServiceKey decoration in the class is not doing anything.

I’m using Visual Studio 2012, .NET Framework 4.0, Silverlight 5.

  • 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-11T16:45:18+00:00Added an answer on June 11, 2026 at 4:45 pm

    This appears to be a limitation of the Reflection Provider, and probably not an intended limitation. I’ll file this as a bug internally, but here is a workaround until we get to a fix…

    You can use the new modifier to hide pass the desired values through/from the base class:

    using System;
    using System.Data.Services.Common;
    
    namespace SO.OData
    {
        [DataServiceKey("PartitionKey", "RowKey")]
        public class Question : TableServiceEntry
        {
            public new string PartitionKey
            {
                get { return base.PartitionKey; }
                set { base.PartitionKey = value; }
            }
    
            public new string RowKey
            {
                get { return base.RowKey; }
                set { base.RowKey = value; }
            }
    
            public string Text { get; set; }
            public User AskedBy { get; set; }
            public DateTimeOffset AskedAt { get; set; }
        }
    
        public abstract class TableServiceEntry
        {
            public string PartitionKey { get; set; }
            public string RowKey { get; set; }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does following code snippet doesn't work? It doesn't gives any error, but also
Why does the following code give me an error (g++ 4.1.2)? template<class A> class
Why does the following code get the runtime error: Members of the Triggers collection
I am using following code to get all the pages of pages WCF Service:
I'm getting an error when using Entity Framework - Code First in the following
I am using the following code to update an entity. Service.Update(_policy); where policy is
Does the following code contain a memory leak of the first three characters in
Does the following code will increase the allocated memory continuously as it is called
Why does the following code throw ArrayStoreException ? double[] a = {2.0,3.4,3.6,2.7,5.6}; int[] b
Why does the following code give me a segmentation fault? #define MAXROWS 10 #define

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.