public static bool Match(SimpleNativeQuery query, object o) { MethodInfo method = methodsCache[query]; object[] @params = new object[] { o }; object result; try { result = method.Invoke(query, @params); } catch (System.Exception e) { throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.QueryNqExceptionRaisedByNativeQueryExecution .AddParameter(query.GetType().FullName), e); } return ((bool)result); }
public static string GetFullClassName(SimpleNativeQuery query) { System.Type clazz = query.GetType(); System.Reflection.MethodInfo[] methods = OdbReflection.GetMethods(clazz); for (int i = 0; i < methods.Length; i++) { System.Reflection.MethodInfo method = methods[i]; System.Type[] attributes = OdbReflection.GetAttributeTypes(method); if (method.Name.Equals(MatchMethodName) && attributes.Length == 1) { clazz = attributes[0]; methodsCache.Add(query, method); return OdbClassUtil.GetFullName(clazz); } } throw new ODBRuntimeException(NeoDatisError.QueryNqMatchMethodNotImplemented.AddParameter(query.GetType().FullName)); }