Calling Static Derived Class Method from Static Base Class Method
<p>Problem: I have an entity class (base class), from which I inherit multiple times. Now I have an <code>Add</code>-method and a <code>Validate</code>-method in all of my derived classes. These functions are identical in all derived class and they are <code>static</code>.</p>

<p>Here is my <code>Add</code>-method</p>

<pre><code>public static long Add(DBData[] UserData)
{
    SortedDictionary&lt;string, DBData&gt; Data = new SortedDictionary&lt;string, DBData&gt;();

    foreach (DBData d in UserData)
    {
        Data.Add(d.FieldName, d);
    }

    if (Project.Validate(Data, OperationMode.Add))
    {
        return DBUtility.Insert("Project", VSCommon.Serialise(Data));
    }
    else
    {
        return -1;
    }
}
</code></pre>

<p>Now where I have "<code>Project</code>" in above function (2 places, one if object of type <code>Project</code> this function belong too, and other is the database table name). These are the only differences in all my derived classes. I want to put this <code>Add</code>-method in my base class, so I can skip writing it multiple times in every derived class. </p>

<p>I search and found that some try to use generics but I didn't seem to pick it up as when I use generic declaration. When I call the <code>Validate</code>-method a compilation error came by. Also, I need the name of the class as <code>string</code> to get relevant table name. </p>

<p>Not sure I am able to define my problem, any help is appreciated. Thanks.</p>
