protected ISqlExpression[] ConvertArgs(MemberInfo member, ISqlExpression[] args) { if (member is MethodInfo) { var method = (MethodInfo)member; if (method.DeclaringType.IsGenericType) args = args.Concat(method.DeclaringType.GetGenericArguments().Select(t => (ISqlExpression)SqlDataType.GetDataType(t))).ToArray(); if (method.IsGenericMethod) args = args.Concat(method.GetGenericArguments().Select(t => (ISqlExpression)SqlDataType.GetDataType(t))).ToArray(); } if (ArgIndices != null) { var idxs = new ISqlExpression[ArgIndices.Length]; for (var i = 0; i < ArgIndices.Length; i++) idxs[i] = args[ArgIndices[i]]; return idxs; } return args; }