/// <summary> /// Evaluates the expression and returns a value of type <typeparamref name="T"/> representing its value. /// </summary> /// <exception cref="CompilationException">Thrown when <see cref="Evaluatable.Text"/> could not be compiled as expression.</exception> /// <exception cref="RuntimeException">Thrown when an error during evaluation occured.</exception> public T Evaluate() { EnsureCompiled(); object result = _runtimeExpression.GetValue(); if (result == null) { return(_nullValue); } return((T)result); }