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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:31:58+00:00 2026-06-01T00:31:58+00:00

I have multiple classes that will store similar data for different uses and I

  • 0

I have multiple classes that will store similar data for different uses and I simply would like them to be based of the same base class and serialize all the data to XML however I wish to change the Element Names when it serializes. This is in C#.

I want to use the Class names to make it easier to read my code and simpler to implement.

public BaseMenuItem
{
   public string ItemName;
   public string ItemDescription
   public string ItemAssetName; 
   public List<BaseMenuItem> SubMenuItems;
}

then have other items inherit this and serialize it with different element names.
I currently have them different classes with no base class, however using the same base class would make it easier to implement and more extensible so I am at a bit of a loss of how to achieve the overriding element names of the variables I defined of the base class.

  • 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-01T00:31:59+00:00Added an answer on June 1, 2026 at 12:31 am

    In this case I would say the “base class requirement” is causing you more pain than the value it is delivering.

    If you are only using the base class to save some code, ie you don’t want to have extra properties in sub classes? If so just give in and remove the base class. At the cost of having a few extra lines in each sub class you will have less pain moving forward.

    If you require the base class for programmatic reasons? For example operations are performed on the base class specifically (polymorphism). Use an interface instead of a base class.

    Either way remove the base class.

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

Sidebar

Related Questions

I have a multiple ModelForm classes that each represent a different Model. I would
I have multiple files and classes. To put it simply, one will run calculations
I have multiple classes that do lengthy tasks in threads and want them to
I have multiple classes that all derive from a base class, now some of
Is it possible to have multiple classes that inherit/extends same class in Google AppEngine
The situation: I have multiple classes that should each hold a variable with a
In Django, when you have a parent class and multiple child classes that inherit
I have a C# singleton class that multiple classes use. Is access through Instance
Will Oracle flatten multiple between clauses if they have overlapping data? In my application,
I have multiple projects in a couple of different workspaces. However, it seems like

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.