title: Assign Value in List using lambda expression
body: <p>I have following classes:</p>
  
  <pre><code>public class ProviderQualificationTimeViewModel
  {
      public string SessionId { get; set; }
      public List&lt;ProviderQualificationDetail&gt; ProviderQualificationDetails { get; set; }
  }
  
  public class ProviderQualificationDetail
  {
      public string ProviderName { get; set; }
      public string ProviderQualificationTime { get; set; }
      public string TotalServiceableOffers { get; set; }
  }
  </code></pre>
  
  <p>Basically, I want to create a new object if condition is true else I want to update <code>ProviderQualificationDetail.ProviderQualificationTime</code> where ProviderQualificationDetail.ProviderName == providerName
  Is it possible using lambda expression?</p>
  
  <pre><code>List&lt;ProviderQualificationDetail&gt; providerQualificationDetail = new List&lt;ProviderQualificationDetail&gt;();
  
  foreach (ProviderModel providers in allProviders)
  {
      if(!providerQualificationDetail.Any(p=&gt;p.ProviderName.Contains(providerName)))
      {
          ProviderQualificationDetail ProviderQualificationDetail = new ProviderQualificationDetail();
          ProviderQualificationDetail.ProviderName = providerName;
          ProviderQualificationDetail.ProviderQualificationTime = Math.Round(processingTime).ToString();
          ProviderQualificationDetail.TotalServiceableOffers = "Not serviceable";
          providerQualificationDetail.Add(ProviderQualificationDetail);
      }
      else
      {
          //Lambda expression here
      }
  }
  </code></pre>