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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:02:28+00:00 2026-06-08T02:02:28+00:00

I have a class (person) that is a model in my MVVM application. I

  • 0

I have a class (person) that is a model in my MVVM application. I want to save this class to Azure Table Storage. To save to Azure Table Storage, you need to derive from a class called TableServiceEntity. I’d prefer to not clutter my nice class with attributes meant for storage (seems like a good idea in considering separation of concerns).

Can I somehow have my class derive from TableServiceEntity at run-time, inside the methods that receive the object as a parameter and persist it to storage? That would let my class stay clean of the storage attributes, but still let me save it to Table Storage.

Thanks!
Andy

  • 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-08T02:02:30+00:00Added an answer on June 8, 2026 at 2:02 am

    You could simulate something like it using a DynamicObject or Castle Proxy. Instead of saving Person to azure, you could create an AzureEntity using one of those techniques, and generate an object that has all the same properties as Person, yet it inherits from TableServiceEntity.

    The TableServiceEntity thing, is only done for ease of use… You could get your hands on the storage client library source code (which is published somewhere around git hub or codeplex as far as I remember), and modify it to work without using the TableServiceEntity thing.

    Update for comment:
    In your case you can use both… The difference is that in expando object you define the object by extension, while the dynamic object is defined by comprehension. Dynamic object is a little more powerful (and more complex), but you don’t need any of that in this case.
    BTW: The Castle Proxy is pretty similar to the dynamic object approach, but it generates a lot of the code at runtime, so it’ll probably achieve a far better performance than either the dynamic object, or the expando object.

    Further update:
    You can make expando object implement an interface like this.

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

Sidebar

Related Questions

I have a Django model that looks something like this: class Person(models.Model): name =
Scala programmer should have known that this sort of writing : class Person{ var
If I have this model: class Person(models.Model): name=models.CharField(max_length=28) mother=models.ForeignKey(self,null=True,blank=True) I am trying to make
I have this in my model: class Person < ActiveRecord::Base RELATIONSHIP_STATUSES = [ single,
Hi I have models like this : public class Person extends Model { ...
I have created a class Person that looks like this: public class Person {
I have this model : public class Person { public string Name { get;
Say I have some django models, something like this: class Address(models.Model): pass class Person(models.Model):
I have an simple class that I get from a webservice. public class person
I have a class Client like that: public class Client { public Person Pers

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.