title: Using lambda to specify property to Helper class from Razor Partial View
body: <p>I'm trying to write a EditorTemplate to generically apply CSS classes dependent upon logic provided in a helper passing the model and additional data from the ViewBag:</p>
  
  <pre><code>@using LSC.DCMP.Web.UI.Helpers
  @model String
  
  @ValidationFieldHelper.GetCSSClass(m =&gt; Model, @ViewBag.Step) 
  </code></pre>
  
  <p>This matches to a helper class that currently isn't implemented, but has the following signature:</p>
  
  <pre><code>public static class ValidationFieldHelper
  {
      public static object GetCSSClass(Func&lt;object, string&gt; func, object step)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>
  
  <p>When I try to run the application, it fails compilation with the following error:</p>
  
  <blockquote>
    <p>"Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type".</p>
  </blockquote>
  
  <p>I've read that lambda syntax isn't fully supported using Razor templates so I'm unsure how I can implemented this functionality.</p>