title: Get element from List if exists
body: <p>I'm trying to get 2 first values from list and store them in two variables. If list contains >= 2 values I should set <code>variable1</code> and <code>variable2</code>, but if values list is shorter I should get <code>null</code> as <code>variable1</code> and/or <code>variable2</code>. </p>
  
  <p>I'm now stuck with this code:</p>
  
  <pre><code>var variable1 = values.Take(1).FirstOrDefault(); // I know it can be just FirstOrDefault()
  var variable2 = values.Skip(1).Take(1).FirstOrDefault();
  </code></pre>
  
  <p>But this looks kinda hacky. Is there any cleaner way to get it? Something like:</p>
  
  <pre><code>var variable1 = values.TakeOrDefault(0); //getting first element or default
  var variable2 = values.TakeOrDefault(1); //getting second element or default
  </code></pre>