Since I am using two different generic collection namespaces (System.Collections.Generic
and Iesi.Collections.Generic
), I have conflicts. In other parts of the project, I am using both the nunit and mstest framework, but qualify that when I call Assert
I want to use the nunit version by
using Assert = NUnit.Framework.Assert;
Which works great, but I want to do the same thing with generic types. However, the following lines do not work
using ISet = System.Collections.Generic.ISet;
using ISet<> = System.Collections.Generic.ISet<>;
Does anyone know how to tell .net how to use the using statement with generics?
I think you're better off aliasing the namespaces themselves as opposed to the generic types (which I don't think is possible).
So for instance:
using S = System.Collections.Generic;
using I = Iesi.Collections.Generic;
Then for a BCL ISet<int>
, for example:
S.ISet<int> integers = new S.HashSet<int>();