Can I have a class within a class in C#
<p>I have the following class:</p>

<pre><code>public class NoteLink
{

    public IList&lt;NoteLinkDetail&gt; NoteLinkDetails
    {
        get { return _noteLinkDetails; }
    }
    private List&lt;NoteLinkDetail&gt; _noteLinkDetails = new List&lt;NoteLinkDetail&gt;();

    public NoteLink()
    {
        _noteLinkDetails = new List&lt;NoteLinkDetail&gt;();
    }

}
</code></pre>

<p>and then another class that's used just within the first class.</p>

<pre><code>public class NoteLinkDetail
{
    public string L { get; set; }
    public string R { get; set; }
}
</code></pre>

<p>Is there anything I could do to optimize this. I DO need the second class as I use JSON to store the contents of NoteLinkDetail in a string. However is there such a thing as an inner class in C#?  Any recommendation on how I could optimize this code? Thanks.</p>
