public override IExpression Evaluate(IExpressionContext ctx) { if (ctx == null) { throw new NullReferenceException("Cannot resolve variable without a context"); } var rawValue = ctx.ResolveVariable(_variable); var constValue = rawValue as IValueType; return(constValue ?? ValueTypeConverter.ConvertTo(rawValue)); }