I have a generic exception class, for example:
public class DuplicateException<TEntity> : Exception { public TEntity Entity { get; set; } }
And I have a non-generic method that can throw a generic exception thrown:
void Save() { throw new DuplicateException<SomeEntity>(); }
This method can throw this general exception, but only from this constructed type DuplicateException<SomeEntity> , and it cannot pass this exception with any other type parameter instead of SomeEntity .
Now I want to indicate this fact in xml-comment for the Save method. This article describes a little how to comment on methods with a general exception, and I tried these two alternatives:
1) Inserts default autocomplete in VS:
2) Replaced TEntity with SomeEntity
But in both cases, the output XML still claims that this method can invoke a generic unconstructed type that SomeEntity does not mention at SomeEntity :
<exception cref="T:MyNameSpace.DuplicateException`1" />
source share