title: How to write strongly typed lambda expressions?
body: <p>I want to write a lambda expression within an inline if statement. But inline if statement must have strong type results.</p>
  
  <pre><code>MyType obj = someObj.IsOk ? null : () =&gt; {
     MyType o = new MyType(intVal);
     o.PropertyName = false;
     return o;
  };
  </code></pre>
  
  <p>Of course this doesn't work, because lambda expression isn't strongly typed. I thought of using <code>Func&lt;intVal, MyType&gt;</code> delegate, to make it strong type.</p>
  
  <p>But how do I use this <code>Func&lt;&gt;</code> inside inline if? Is it at all possible of would I have to define my own function outside and use it in inline if statement?</p>