When adding to a list, if I add the property of a class instance, is it set to a reference of the property's value or a reference to the property?
Example:
If I have:
class A {
public Action<Guid> SomeDelegate { get; set; }
}
And in a different class I create an instance of class A, ie:
class B {
public B() {
a = new A();
a.SomeDelegate = someFunction;
List<Action<Guid>> myList = new List<Action<Guid>>;
myList.Add(a.SomeDelegate);
a.SomeDelegate = anotherFunction;
}
}
What will be in myList
? A reference to anotherFunction
or a reference to someFunction
?
If it is a reference to someFunction
, how would I go about making it a reference to anotherFunction
?
Thanks!