Question: I am a new to C#, I need a small help on how can I pass multiple parameters between the classes?
Below is a small example but my parameters will more than the 10. Is there another way to this? 

```
public StreamStructure(String name, string id, string classname, int number)
    {
        this.name = name;
        this.id = id;
        this.classname = classname;
        this.number = number;
    }

```

List ------ 

```
List<abc> don = new List<abc>();
            foreach (XmlElement abc_cdb in abc_cdbs)
            {

                abc.Name = abc_cdb.GetAttribute("NAME");
                abc.Id = abc_cdb.GetAttribute("id");
                abc.Clssname = abc_cdb.GetAttribute("classname");
                abc.number = Convert.ToInt32(abc_cdb.GetAttribute("number"));
                don.Add(abc);

               }

```

I have used as suggested in ans but I am trying to create a list in C# my first record gets replaced with the 2nd one, since the fields in MyDTO are defined as public. Do you have any idea how to fix this?

Answer: 
You are probably better off using [C# Initializers](http://msdn.microsoft.com/en-us/library/bb384062.aspx) or a [Data Transfer Object](http://msdn.microsoft.com/en-us/library/ff649585.aspx) than a large number of constructor parameters. Or combine the two.

```
public class MyDTO
{
   String Name { get; set; }
   String Id { get; set; }
   String ClassName { get; set; }
   int Number { get; set; }
}

var MyDTO = new MyDTO() 
{
   Name      = Name,
   Id        = Id,
   ClassName = ClassName,
   Number    = Number
}

var stream = new StreamStructure(MyDTO) 

```

To create a list of these objects as in your example, create a new DTO within the loop body.

```
var don = new List<MyDTO>(); 
foreach (XmlElement abc_cdb in abc_cdbs) 
{
    var abc = new MyDTO()
    {
        Name = abc_cdb.GetAttribute("NAME");
        Id = abc_cdb.GetAttribute("id");
        ClassName = abc_cdb.GetAttribute("classname");
        Number = Convert.ToInt32(abc_cdb.GetAttribute("number"));
    };

    don.Add( abc );
}

```
You should write a new class that contains the properties you want to pass to the method, and change your method to include just that new class.

For your example, write a new class like this:

```
public class RequestObject
{
    public string Name { get; set; }
    public string ID { get; set; }
    public string ClassName { get; set; }
    public int Number { get; set; }
}

```

Then change your method like this:

```
public StreamStructure(RequestObject requestObject)
{
    //DoStuff
}

```