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

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

The Archive Base Latest Questions

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

I’m accessing a Person entity using Azure Table Storage via OData (WCF Data Service).

  • 0

I’m accessing a “Person” entity using Azure Table Storage via OData (WCF Data Service). I was having lots of issues for getting this to work. I was having this error:

Entity code:

public class Person : TableServiceEntity
{
public string Name { get; set; }
... etc

URI:
http://127.0.0.1/DataService/PersonDataService.svc/Person

Result:

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

After a lot of troubleshooting, I found out through this post that in order to get around this error, I could add to my entity :

1) [DataServiceKey] attribute to add custom Keys (I need [DataServiceKey(“PartitionKey”, “RowKey”)])

2) By looking for a “PersonID” property (This is the only one that works for me)

3) By looking for an “ID” property

No 1 is the only one that works for me. I had to add a “PersonID” column, like this:

Entity code:

public class Person : TableServiceEntity
{
public Guid PersonID { get; set; } //This is absolutely necessary to get around the aforementioned error
public string Name { get; set; }
... etc

I successfully get data via http://127.0.0.1/DataService/PersonDataService.svc/Person or by specifying the PersonID:
http://127.0.0.1/DataService/PersonDataService.svc/Person(guid’e4a924d1-a564-45d7-9e3e-fe0396d08f8e’)

I would like to specify a custom Primary Key column, such as PartitionKey/RowKey (coming from TableServiceEntity), but using this code does not help:

[DataServiceKey("PartitionKey", "RowKey")]
public class Person : TableServiceEntity
{
public string Name { get; set; }
... etc

Is this a bug?
Do I have to follow that convention for every entity that I have? Person => PersonID, Foo => FooID, etc.

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

  • 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-11T09:43:18+00:00Added an answer on June 11, 2026 at 9:43 am

    As per WCF Data Service and Azure Table Storage: How can I use PartitionKey / RowKey as primary keys…

    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

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to

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.