An empty Assembly Attribute element
<p>My application has some assemblies. I've decided to write a proxy class for it. It loads assembly attributes in its constructor and stores them in readonly fields.</p>

<p>It works something like this:</p>

<pre><code>public class AssemblyInfo
{
    private readonly Assembly ActiveAssembly;
    private readonly AssemblyName ActiveAssemblyName;
    public AssemblyInfo()
    {
        ActiveAssembly = System.Reflection.Assembly.GetEntryAssembly();
        ActiveAssemblyName = ActiveAssembly.GetName();
        FileVersionInfo = FileVersionInfo.GetVersionInfo(ActiveAssembly.Location);
        if (ActiveAssembly != null)
        {
            Title = this.GetAttributeByType&lt;AssemblyTitleAttribute&gt;().Title;
        }
    }
    public readonly string Title;
}
</code></pre>

<p>And, in an another assembly:</p>

<pre><code>sealed class CurrentAssemblyInfo : AssemblyInfo
{
}
</code></pre>

<p>It works fine, but I have a problem with GetAttributeByType function. Currently it's written this way:</p>

<pre><code>private T GetAttributeByType&lt;T&gt;() where T : Attribute
{
    object[] customAttributes = ActiveAssembly.GetCustomAttributes(typeof(T), false);
    if ((customAttributes != null) &amp;&amp; (customAttributes.Length &gt; 0))
        return ((T)customAttributes[0]);
    return null;
}
</code></pre>

<p>It works fine (and saves a lot of place). But if nothing is found, I return null and that doesn't work fine if such an attribute isn't find.</p>

<p>Is there any way to return something like a "empty object" for these Attribute classes. I've checked MSDN. but it looks like all of these Assembly*Attribute classes doesn't have even empty constructor.</p>
