I have an object 'connection' which holds the path/credentials to a SQL DB.When calling methods; we usually do this:Connection con = new Connection();GetSalesData(con);public static void (Connection con){   // Run code}As I understand, we just created two instance of connection, so that means two memory allocations. Is it better to do this:Connection con = new Connection();GetSalesData(ref con);public static void (ref Connection con){   // Run code}
If it's a static object is using ref as method argument better?
c#