title: Lambda expression - For a Select New
body: <p>I am trying to create a custom collection from an IQueryable object, where i am trying to perform a select statement but getting an error cannot convert to store expression. I am new to Lambda Expression. Kindly help me how to fix this problem.</p>
  
  <p>Getting error at line c.Event.FirstUpper()</p>
  
  <pre><code>public static string FirstCharToUpper(string input)
  {
      if (String.IsNullOrEmpty(input))
          return string.Empty;
  
      var trimmed = input.Trim();
      return trimmed.First().ToString().ToUpper() + trimmed.Substring(1);
  }
  
  
  public static Expression&lt;Func&lt;string, string&gt;&gt; GetFirstCaseToUpperExpression()
  {
      var expression = NJection.LambdaConverter.Fluent.Lambda.TransformMethodTo&lt;Func&lt;string, string&gt;&gt;()
                               .From(() =&gt; StringFormatter.FirstCharToUpper)
                               .ToLambda();
       return expression;
  }
  </code></pre>
  
  <p>Calling the Expression</p>
  
  <pre><code>return new List&lt;LoggerModel&gt;( 
      logDB.PELoggers
           .Where(c =&gt; (c.SubscriberCode == SubscriberCode)).OrderByField(sortBy, ascendingOrder).Select(c =&gt; new LoggerModel()
                     {
                         DateTime = c.DateTime.Value,
                         Event = c.Event.FirstUpper()
                     })
  </code></pre>