Skip to main content
A newer version of this page is available. .

ICustomFunctionOperatorQueryable.GetMethodInfo() Method

When implemented by a class, returns the metadata of a method associated with a custom function used in LINQ to XPO expressions.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v18.2.dll

Declaration

MethodInfo GetMethodInfo()

Returns

Type Description
MethodInfo

A MethodInfo object which identifies the method to be used to evaluate a custom function, based on specified function parameters.

Remarks

The code below shows a sample GetMethodInfo implementation.


public class MyConcatFunction : ICustomFunctionOperatorBrowsable, ICustomFunctionOperatorFormattable,
    ICustomFunctionOperatorQueryable {
    const string FunctionName = "MyConcat";
    static readonly MyConcatFunction instance = new MyConcatFunction();
    public string ICustomFunctionOperator.Name {
        get { return FunctionName; }
    }
    // ...

    // The method name must match the function name 
    // returned by the ICustomFunctionOperator.Name property implementation.
    public static string MyConcat(string string1, string string2, string string3, string string4) {
        return (string)instance.Evaluate(string1, string2, string3, string4);
    }
    #region ICustomFunctionOperatorQueryable Members
    public System.Reflection.MethodInfo GetMethodInfo() {
        return typeof(MyConcatFunction).GetMethod(FunctionName);
    }
    #endregion
}

To see the entire example, see the How to: Implement Custom Functions and Criteria in LINQ to XPO.

See Also