Usage of Expression> I am developing data-interfacing that converts between two different data models.
However, I must be sure that all required fields exist. Therefore I have written this utility class that I can easily use to verify required fields.

However I am unsure whether this is the best way because of the expression that needs to be compiled and the usage of reflection. Any feedback is welcome!

Usage

    public OutputDataElement DetermineRetailTransactionShopperType(IHeaderEntity headerEntity)
    {
        Ensure.IsNotNull(() =&gt; headerEntity);
        Ensure.IsNotNull(() =&gt; headerEntity.ShopId, "headerEntity");

        // Some mapping logic removed from the example
    }        


Utility

/// &lt;summary&gt;
/// Helper class able to ensure expectations
/// &lt;/summary&gt;
public static class Ensure
{
    public static void IsNotNull&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; property) where T : class
    {
        IsNotNullImpl(property, null);
    }

    public static void IsNotNull&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; property, string paramName) where T : class
    {
        IsNotNullImpl(property, paramName);
    }

    private static void IsNotNullImpl&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; property, string paramName) where T : class
    {
        // Compile the linq expression
        Func&lt;T&gt; compiledFunc = property.Compile();

        // Invoke the linq expression to get the value
        T fieldValue = compiledFunc.Invoke();

        // Check whether we have a value
        if ((fieldValue is string &amp;&amp; fieldValue.ToString() == string.Empty) || (fieldValue == null))
        {
            // We have no value. Get the initial expression
            var expression = (MemberExpression)property.Body;

            // log information about the expression that failed
            throw new ArgumentException(string.Format("Missing required field '{0}'", expression.Member.Name), string.IsNullOrEmpty(paramName) ? null : paramName);
        }
    }
}
I don't see any unnecessary reflection in your code.

One think that could be simplified is your check for string.Empty:

if (fieldValue == null || fieldValue as string == string.Empty)