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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:34:57+00:00 2026-06-04T22:34:57+00:00

I have a question about how my classes should be mapped into Azure Table

  • 0

I have a question about how my classes should be mapped into Azure Table Storage entities. Say I have two entities, BikeRider and BikeRace. In my C# code, I have 2 classes, and each one has a property that is a collection of the other. So the BikeRider class has a List property, and vice versa. If that’s not ideal here, feel free to opine, but that’s what I’ve got today.

How does that map into an Azure Table? I’ve found questions on SO here that discuss how to store a many to many relationship, but my question is more specifically how a List property should be handled when you save the object containing that property.

thanks!

UPDATE
While I was waiting for a reply to this (and thinking I might not get any), I came up with this solution:

The C# BikeRider and BikeRace types both have a List property of the type of the other, as I described above. Each has an instance method to Add an instance of the other to their list (i.e. BikeRace has a method called “AddBikeRider” that adds an instance of BikeRider to the BikeRace.BikeRiders list, and vice versa).

However, when I save to Azure Table Storage, there are 3 tables with the following information:

BikeRider Table

  • PartitionKey, RowKey,

BikeRider Info RiderRace Table

  • PartitionKey: BikeRider RowKey
  • RowKey: BikeRace RowKey
  • Other Info

BikeRace Table

  • PartitionKey, RowKey
  • A separate value for the ID of every BikeRider in the race (the BikeRider RowKey – but could have many).

This way, if you are querying from the BikeRider and trying to get the BikeRaces he’s been in, you have the partition key, and all of the rows in that partition are the BikeRaces. If you’re querying from the BikeRace, and trying to get all the BikeRiders in a race, you have the BikeRider ID’s to use in querying the BikeRider table. You’re not duplicating data beyond storing those keys in multiple places, so you don’t have to multiple storage locations if your data changes.

The challenge here is what Ming has posted – if the Table Service save method throws an exception for a type with a List property, can you create a simpler interface with its own preliminary save method that handles the list type and turns it into a save-able data type first, to persist it to the Azure Tables in the way I described? Is this too complicated, or too brittle?

  • 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-04T22:34:58+00:00Added an answer on June 4, 2026 at 10:34 pm

    this is not supported. Table storage does not support list properties. If you use a list property in your CLR data model, WCF Data Services will try to serialize it, and result in an exception.

    To simulate a relationship, you can create a property on the BikeRace entity, such as BikeRiderID.

    If you need a read only collection, you can create a method (instead of a property) in the BikeRider class, such as GetBikeRaces. Inside the implementation, you query the BikeRace table to find all entities whose BikeRiderID is the current bike rider’s ID. If you want to update the list of bike races, you also need to update the BikeRider table using a separate request.

    You can refer to http://blog.smarx.com/posts/one-to-many-relationships-in-windows-azure-tables for a sample.

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

Sidebar

Related Questions

I have some rudimentary question about inheritance in C#. I have two classes. I
I have a question about a ' modeling, training ' classes, there are two
A question about boost::shared_ptr here: I have 3 Classes. A is some kind of
I have a question about how to set up the relations between two models
I have a (simple) question about generic classes in c++. I have some knowledge
Good day everyone. I have a question about making and using derived classes of
I have a question about unit testing. Say I have a controller with one
I've got question about nested inheritance in C++. I have three classes: Base ,
I have started reading C++ and I have a question about classes and member
I have question about normalization. Suppose I have an applications dealing with songs. First

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.