title: Doesn't C# Extension Methods allow passing parameters by reference?
body: <p>Is it really impossible to create an extension method in C# where the instance is passed as a reference?</p>
  
  <p>Here’s a sample VB.NET console app:</p>
  
  <pre><code>Imports System.Runtime.CompilerServices
  
  Module Module1
    Sub Main()
      Dim workDays As Weekdays
  
      workDays.Add(Weekdays.Monday)
      workDays.Add(Weekdays.Tuesday)
  
      Console.WriteLine("Tuesday is a workday: {0}", _ 
        CBool(workDays And Weekdays.Tuesday))
      Console.ReadKey()
    End Sub
  End Module
  
  &lt;Flags()&gt; _
  Public Enum Weekdays
    Monday = 1
    Tuesday = 2
    Wednesday = 4
    Thursday = 8
    Friday = 16
    Saturday = 32
    Sunday = 64
  End Enum
  
  Module Ext
    &lt;Extension()&gt; _
    Public Sub Add(ByRef Value As Weekdays, ByVal Arg1 As Weekdays) 
      Value = Value + Arg1
    End Sub
  End Module
  </code></pre>
  
  <p>Note the Value parameter is passed ByRef.</p>
  
  <p>And (almost) the same in C#:</p>
  
  <pre><code>using System;
  
  namespace CS.Temp
  {
    class Program
    {
      public static void Main()
      {
        Weekdays workDays = 0;
  
        workDays.Add(Weekdays.Monday); // This won't work
        workDays.Add(Weekdays.Tuesday);
  
        // You have to use this syntax instead...
        // workDays = workDays | Weekdays.Monday;
        // workDays = workDays | Weekdays.Tuesday;
  
        Console.WriteLine("Tuesday is a workday: {0}", _ 
          System.Convert.ToBoolean(workDays &amp; Weekdays.Tuesday));
        Console.ReadKey();
      }
    }
  
    [Flags()]
    public enum Weekdays : int
    {
      Monday = 1,
      Tuesday = 2,
      Wednesday = 4,
      Thursday = 8,
      Friday = 16,
      Saturday = 32,
      Sunday = 64
    }
  
    public static class Ext
    {
      // Value cannot be passed by reference? 
      public static void Add(this Weekdays Value, Weekdays Arg1) 
      {
        Value = Value | Arg1;
      }
    }
  }
  </code></pre>
  
  <p>The <code>Add</code> extension method doesn’t work in C# because I can’t use the <code>ref</code> keyword. Is there any workaround for this?</p>