title: Query using LINQ to SharePoint with lambda expression against PeoplePicker - client object model
body: <p>I have a sharepoint 2010 list. I'm writing code against the client object model. </p>
  
  <p>I use CAML to retrieve a set of sharepoint list items. </p>
  
  <p>After that, I need to filter for a subset of these records, based on info that is stored in a People Picker column. (So I only wanna get results, where e.g. the PeoplePicker is set to John Smith.)</p>
  
  <p>I know that in order to access the peoplepicker, it has to be declared as a FieldUserValue. However, I can't seem to do that within a lambda expression. </p>
  
  <p>The below is how things should work ideally. But of course this doesnt compile as I cant declare the "EngineerAccount" as a FieldUserValue within the lambda expression.</p>
  
  <pre><code>FieldUserValue usvAss = i["EngineerAccount"] as FieldUserValue;
  
  double totalTT = collListItemAss.Where(item =&gt; item["EngineerAccount"] as FieldUserValue == usvAss.LookupValue).Sum(sItem =&gt; Convert.ToDouble(sItem["field3"]));
  </code></pre>
  
  <p>Any ideas?</p>
  
  <hr>
  
  <p>I'm sorry this is not solved.</p>
  
  <p>I have 3 points. </p>
  
  <p><strong>1: This part seems to be unneccessary</strong></p>
  
  <pre><code>`item["EngineerAccount"].GetType() == typeof(FieldUserValue)
  </code></pre>
  
  <p><strong>2: This code doesnt comply. Also, it is logically incorrect. The "FieldUserValue" is a complex field containing multiple information.</strong> The problem is that I'm trying to 'equate" a FieldUserValue with a string, two different types.</p>
  
  <pre><code>(FieldUserValue)item["EngineerAccount"] == usvAss.LookupValue
  </code></pre>
  
  <p><strong>3: Logically, it should be like this, but this doesnt work:</strong> </p>
  
  <pre><code>(FieldUserValue)item["EngineerAccount"].LookupValue == usvAss.LookupValue
  </code></pre>
  
  <p>Please help, I'm out of ideas right now!</p>