title: Update property or create new element if it does not exist Lambda c#
body: <p>I have a large List&lt;> of Name/Value pairs and need to be able to find if a particular Name exist in this list...if so update that Value, if NOT then create a new Name/Value pair and append it to my List.</p>
  
  <p>What is the Lambda syntax to do this?</p>
  
  <p>I have tried using .Where .DefaultIfEmpty but it just returns an empty object but does not append it to my original 'myList'</p>
  
  <pre><code>myList.Where(x =&gt; x.Name == 'some name').DefaultIfEmpty(new myobj(){ Name = 'some name').First().Value = 'some value';
  </code></pre>
  
  <p>I have to do this four multiple Names so if I had a simple syntax that would make it great =)</p>