How to specify a generic with a where?
<p>I tried to specify this generic but I am getting multiple errors:</p>

<pre><code>    public void AddOrUpdate(T item, V repo) where T: IAuditableTable, V: IAzureTable&lt;TableServiceEntity&gt;
    {
        try
        {
            V.AddOrUpdate(item);
        }
        catch (Exception ex)
        {
            _ex.Errors.Add("", "Error when adding account");
            throw _ex;
        }
    }
</code></pre>

<p>For example the ":" just after the V on the first line gives an error: </p>

<pre><code>Error   3   ; expected
</code></pre>

<p>plus other errors:</p>

<pre><code>Error   2   Constraints are not allowed on non-generic declarations 
Error   6   Invalid token ')' in class, struct, or interface member declaration 
Error   5   Invalid token '(' in class, struct, or interface member declaration 
Error   7   A namespace cannot directly contain members such as fields or methods   
Error   8   Type or namespace definition, or end-of-file expected
</code></pre>

<p>Is there something obviously wrong with my generic coding ?</p>

<p><strong>Update:</strong></p>

<p>I made changes and the code now looks like this:</p>

<pre><code>public void AddOrUpdate&lt;T, V&gt;(T item, V repo)
        where T : Microsoft.WindowsAzure.StorageClient.TableServiceEntity
        where V : IAzureTable&lt;TableServiceEntity&gt;
    {
        try
        {
            repo.AddOrUpdate(item);
        }
        catch (Exception ex)
        {
            _ex.Errors.Add("", "Error when adding account");
            throw _ex;
        }
    }
</code></pre>

<p>Calling it from the derived class:</p>

<pre><code>    public void AddOrUpdate(Account account)
    {
        base.AddOrUpdate&lt;Account, IAzureTable&lt;Account&gt;&gt;(account, _accountRepository);
    }
</code></pre>
