title: How to .Select() and change a single property at the same time?
body: <p>I've started with the following statement.</p>
  
  <pre><code>return part
    .Descendants("DataMapping")
    .Select(element=&gt;serializer.Deserialize(element.CreateReader()) as Mapping);
  </code></pre>
  
  <p>Then, it turned out that a property in <em>Mapping</em> isn't set via the serializer so I had to update it manually. Luckily, it's the same value all the way, so the following resolved my issue.</p>
  
  <pre><code>return part
    .Descendants("DataMapping")
    .Select(element =&gt; serializer.Deserialize(element.CreateReader()) as Mapping)
    .Select(element =&gt; new Mapping(element, "blopp"));
  </code></pre>
  
  <p>However, I can't stop thinking that it's a bad design. I'm creating an object twice, to begin with. Also, I had to add a custom constructor, increasing the complexity of the code base.</p>
  
  <p>I haven't found any methods like <em>.ForEach(e=>e.X = ":)"</em> and I wonder if it's at all possible to LINQ through a serializably created objects and set a value of a field at the same time.</p>
  
  <p>I'd like the expression to behave like the below example shows. I can't use a second <em>Select()</em> because then it'd produce an array of <em>String</em> type and I need to keep the original type, only slightly affecting its properties.</p>
  
  <pre><code>return part
    .Descendants("DataMapping")
    .Select(element =&gt; serializer.Deserialize(element.CreateReader()) as Mapping)
    .SomeCommand(element =&gt; element.Extra = "blopp"));
  </code></pre>