Question: I want to define a class inside a class.

example:

```
private class newClient
{
    public int ID { get; set; }
    public string Name{ get; set; }        

    private class ClientExtraData
    {
       public string ExtraField1 { get; set; }
       public string ExtraField2 { get; set; }
    }
}

```

now i want to access the ExtraField1 in such way:

```
newClient nclnt= new newClient();
string s=nclnt.ClientExtraData.ExtraField1;

```

Can this be done?

Answer: 
To Achieve the below, 

```
newClient nclnt= new newClient();
string s=nclnt.ClientExtraData.ExtraField1;

```

All you need to do is expose a property like this

```
private class NewClient
{
        public class NewClient() 
        {
            this.ClientExtraData = new ClientData();
        }
        public int ID { get; set; }
        public string Name{ get; set; }
        public ClientData ClientExtraData {get;set;}
}

```

where `ClientData` is a class in your assembly.
No it can't be done like that. The class is not a method, property or anything which is instanziated by the class.

It is also very bad design :-)

You could however say:

var myclass = new ClassOne.ClassTwo()