fork download
  1. using System;
  2. public class Customer {
  3. public string FirstName { get; set; }
  4. }
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var customer = new Customer() { FirstName = "Simon" };
  11. Example(ref customer);
  12. Console.WriteLine(customer.FirstName);
  13. }
  14.  
  15. public static void Example(ref Customer customer) {
  16. customer = new Customer() { FirstName = "CHANGED" };
  17. }
  18. }
  19.  
  20.  
Success #stdin #stdout 0.02s 33840KB
stdin
Standard input is empty
stdout
CHANGED