title: Getting error in Inline if condition in c#
body: <p>I am trying to get a string value like below</p>
  
  <pre><code>string bsgrpval;
  bsgrpval =
      ConfigurationSettings.AppSettings["Pricing_IncludeALLBaseLineGroup"]=="False"
          ? string.Empty
          : bsgrp.ForEach(x =&gt; bsgrpval = bsgrpval + x.Value.ToString() + ",");
  </code></pre>
  
  <p>I am getting following error:</p>
  
  <blockquote>
    <p>Type of conditional expression cannot be determined because there is
    no implicit conversion between 'string' and 'void'</p>
  </blockquote>
  
  <p>Can somebody help me in this?</p>