class inside a class c#
<p>I want to define a class inside a class.</p>

<p>example:</p>

<pre><code>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; }
    }
}
</code></pre>

<p>now i want to access the ExtraField1 in such way:</p>

<pre><code>newClient nclnt= new newClient();
string s=nclnt.ClientExtraData.ExtraField1;
</code></pre>

<p>Can this be done?</p>
