22 namespace Deveel.Data.Routines {
27 : base(functionInfo) {
29 throw new ArgumentException(
"The information specified are not pointing to any external function.");
34 method = DiscoverMethod();
37 throw new InvalidOperationException();
42 var methodArgs = ConvertArguments(method, args);
43 var result = method.Invoke(null, methodArgs);
45 return context.
Result(ConvertValue(result, ReturnType()));
52 throw new NotImplementedException();
56 var methodParams = methodInfo.GetParameters();
58 if (methodParams.Length != args.Length)
59 throw new InvalidOperationException();
61 var values =
new object[args.Length];
62 for (
int i = 0; i < args.Length; i++) {
63 var paramType = methodParams[i].ParameterType;
66 values[i] = sqlType.
ConvertTo(args[i].Value, paramType);
74 method = DiscoverMethod();
76 return base.ReturnType(context);
82 if (
String.IsNullOrEmpty(methodName))
85 throw new NotImplementedException();
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
A long string in the system.
override SqlType ReturnType(InvokeContext context)
Resolves the function return type against the given context.
A system routine that returns a value at the end of its execution.
string ExternalMethodName
DataObject ConvertValue(object value, SqlType sqlType)
object[] ConvertArguments(MethodInfo methodInfo, DataObject[] args)
DataObject[] EvaluatedArguments
ObjectName RoutineName
Gets the name of the routine that uniquely identifies it in a system context.
ExternalFunction(FunctionInfo functionInfo)
Represents the result of the execution of a routine.
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
FunctionType FunctionType
Gets the kind of function.
virtual object ConvertTo(ISqlObject obj, Type destType)
FunctionType
The different type of a function.
Defines the properties of a specific SQL Type and handles the values compatible.
The function signature information that are used to resolve a function within a context.
InvokeResult Result(DataObject value)
override InvokeResult Execute(InvokeContext context)
Executes the function and provides a result.
static SqlType FromType(Type type)
MethodInfo DiscoverMethod()