Pass by Reference vs Pass by Value

In C# passing by reference means you are essentially passing where an object is in memory. This means if you modify the object in a separate method then it updates the original object.

An example of this is a Dictionary. Passing by reference utilizes the keyword ref or out.

Passing by value which is the default in c# means we are passing a copy and does not modify the original value.

Scroll to Top