Imagine I have a single class, with two instances:
MyClass a = new MyClass();
MyClass b = new MyClass();
MyClass has a method PrintUniqueInstan
Add a Guid property to your class, then in the constructor of the class assign it to NewGuid().
public class MyClass
{
public Guid InstanceID {get; private set;}
// Other properties, etc.
public MyClass()
{
this.InstanceID = Guid.NewGuid();
}
void PrintUniqueInstanceID()
{
Console.Write("Unique ID for the *instance* of this class: {0}", this.InstanceID);
}
}