/// <summary> /// Call filter method if exists. /// </summary> /// <param name="script">Filter method name.</param> /// <param name="json">Json result object which will be filtered.</param> /// <returns>Filtered anonymous object.</returns> protected object CallFilter(Pscript script, object json) { var methodName = script.Name + "Filter"; MethodInfo method = typeof(PscriptsProvider).GetMethod(methodName); return(method.Invoke(this, new object[] { json })); }
/// <summary> /// Check if exist filter method. /// </summary> /// <param name="script">Name of method.</param> /// <returns>True or false.</returns> protected bool filterExist(Pscript script) { var methodName = script.Name + "Filter"; MethodInfo method = typeof(PscriptsProvider).GetMethod(methodName); if (method != null) { return(true); } else { return(false); } }