title: Different ways of passing object to method
body: <p>Consider the following code snippet:</p>
  
  <pre><code>public class Foo
  {
     public int ID { get; set; }
     public string FirstName { get; set; }
     ...
  
     public Foo(int Id, string firstName)
     {
        ID = Id;
        FirstName = firstName;
     }
  }
  </code></pre>
  
  <p>Assuming we have a method which takes in <code>Foo</code> object as a parameter. I can create the object as follows:</p>
  
  <pre><code>var first = new Foo { ID = 1, FirstName = "Test"};
  var second = new Foo(1, "Test");
  </code></pre>
  
  <p>Then pass to the method which is accepting the object as a parameter. My actual classes consist of 10+ properties, I simplified it for the question.</p>
  
  <p>My question is, is there a difference here or both doing the same thing? or it's more a case of preference.</p>
  
  <p>Thanks in advance for your help. </p>