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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:13:19+00:00 2026-05-27T11:13:19+00:00

C#.net 2008 I’m working on a class file with a few hundred properties across

  • 0

C#.net 2008

I’m working on a class file with a few hundred properties across about 8 serialized categories.
At the moment it will look like this:

[CategoryAttribute("Group1")]
public string property
[CategoryAttribute("Group1")]
public string property
[CategoryAttribute("Group1")]
public string property
[CategoryAttribute("Group1")]
public string property

[CategoryAttribute("Group2")]
public string property
[CategoryAttribute("Group2")]
public string property
[CategoryAttribute("Group2")]
public string property
[CategoryAttribute("Group2")]
public string property

I’ve done research in past times and haven’t found any leads to a solution so this time I’m asking if anyone has a solution to get something less messy?
Such as:

[CategoryAttribute("Group1")]
{
public string property;
public string property;
public string property;
public string property;
public string property;
public string property;
public string property;
}
[CategoryAttribute("Group2")]
{
public string property;
public string property;
public string property;
public string property;
public string property;
public string property;
public string property;
}
  • 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-05-27T11:13:20+00:00Added an answer on May 27, 2026 at 11:13 am

    While all the other answers are completely correct, i could propose you another idea.

    You could try to use T4 templates to generate such file.
    Please see my example at GitHub

    Basically I created a template /EntitiesWithALotOfProperties/FirstClass.generated.tt, which reads a file with same name, but with replaced “.generated.tt” to “.template.cs” and processes the latter according to your logic.

    What is important to note: the FirstClass.template.cs should have set the build action to ‘None‘. The idea was: *.cs files can be easily edited with ReSharper (basically have IntelliSense), but at the same time, it doesn’t declare duplicate members.

    Here are some screenshots:
    Another partial part
    Template file
    Generated file

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

Sidebar

Related Questions

I am using VB.NET 2008, and I want to make a DLL that will
I'm using vb.net 2008 and DataGridView. I'm looking for code that will allow me
My team is working with a .NET 2008 DB Project in their solution so
I've tried to create regular setup project in .Net 2008 and it's working fine.
I have created a VB.NET 2008 Class Library that has, for the most part,
Assuming Visual Studio.NET 2008 and MsTest are used to run unit tests. When a
Using Visual Studio .NET 2008 or 2005, is there a way to automatically generate
Using vb.net 2008 I want to display a table in the form, so i
Does Visual Studio .NET 2008 come with UISpy? I ask this for for the
In vb.net (2008), I want to be able to control when a contextMenuStrip (context

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.