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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:18:54+00:00 2026-05-31T05:18:54+00:00

I have public class Convolutions : List<Convolution> { } Which serializes as xml: <ArrayOfConvolution>

  • 0

I have

public class Convolutions : List<Convolution> { }

Which serializes as xml:

<ArrayOfConvolution>
     <Convolution>

But I would like:

<Convolutions>
    <Convolution>

But it is not possible to use [XmlArray("Convolutions")] or [XmlElement(ElementName = "Convolutions")] on a class.
Anyway to acheive this?

  • 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-31T05:18:54+00:00Added an answer on May 31, 2026 at 5:18 am

    If that is the root object, then:

    [XmlRoot("Convolutions")]
    public class Convolutions : List<Convolution> { }
    

    If it is a member of another object, use attributes on the member.

    Another approach, more flexible in many cases, is to use a separate wrapper object and encapsulate the list; frankly, inheriting from lists is not usually very helpful. The following would work:

    public class Convolutions {
        [XmlElement("Convolution")]
        public List<Convolution> Items { get; set; }
    }
    

    or if you don’t like set on your collection members:

    public class Convolutions {
        private readonly List<Convolution> items = new List<Convolution>();
        [XmlElement("Convolution")]
        public List<Convolution> Items { get { return items; } }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have in my WPF project file RssInfo.cs in which I have public class
Let's say I have: public class Fruit { public static List<String> Suppliers { get;
I have a Userdetails class like the one below public class UserDetails { public
I have a user defined class that I want to create a public List
I have public class ViewModel1 { // some properties here public List<ViewModel2> ViewModel2 {get;
I have a simple web service operation like so: @WebService(endpointInterface = soap.service.sei.HelloWorldSei) public class
I have a class like this: public class Foo<T> : IEquatable<T> where T :
Suppose I have: public class foobar { public int lorem; public int ipsum; }
Suppose I have public class Product: Entity { public IList<Item> Items { get; set;
In c# you can have public class Foo { public Foo(string name) { //do

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.