tags:

views:

104

answers:

1

I've created the following class:

[Guid("4469031d-23e0-483c-8566-ce978ccc9a6f")]
class MyGenericContianer<BasicType> : SomeOtherContainer
{
}

This causes the folowing two classes to have the same GUID:

MyGenericContianer<int> x;
MyGenericContianer<float> y;

I need each specific type to have it's own GUID. How would you do this?

+5  A: 

You would need to do this with inheritance.

class MyGenericContianer<BasicType> : SomeOtherContainer { }

[Guid("4469031d-23e0-483c-8566-ce978ccc9a6f")]
class Container1: MyGenericContainer<X> { }

[Guid("5569031d-23e0-483c-8566-ce978ccc9a6f")]
class Container2: MyGenericContainer<Y> { }
Dustin Campbell