Why do these values change like the objects were passed by reference if I set the properties?
<p>Program:</p>

<pre><code>  class Program
  {
    class class1
    {
      public string Name { get; set; }
      public int Value { get; set; }
    }

    class class2
    {
      public string Name { get; set; }
      public int Value { get; set; }
    }

    static void Main(string[] args)
    {
      var Source = new class1() { Name = "Source", Value = 1 };
      var Target = new class2() { Name = "Target", Value = 2 };

      setValue(Source, Target);
      Console.WriteLine(string.Format("Source - Name:{0} Value:{1}", Source.Name,Source.Value));
      Console.WriteLine(string.Format("Target - Name:{0} Value:{1}",Target.Name, Target.Value));
    }

    private static void setValue(object Source, object Target)
    {

      Target  = Source;
    }    
  }  
</code></pre>

<p>When this runs I get(which I expected):</p>

<pre><code>Source - Name:Source Value:1
Target - Name:Target Value:2
</code></pre>

<p>But when I change the setValue method to:</p>

<pre><code>private static void setValue(object Source, object Target)
{
  var source = Source as class1;
  var target = Target as class2;

  target.Name = source.Name;
  target.Value = source.Value;
}  
</code></pre>

<p>I get:</p>

<pre><code>Source - Name:Source Value:1
Target - Name:Source Value:1
</code></pre>
