public override IValueProvider GetValueProvider(ControllerContext controllerContext) { try { var action = ValueProviderHelper.GetControllerActionByContext(HttpContext.Current); return(action.GetParameters().Any(p => p.ParameterType == typeof(T)) ? new FilterOptionsValueProvider <FilterOptions>() : null); } catch (AmbiguousMatchException) { return(null); } }
public bool ContainsPrefix(string prefix) { try { var action = ValueProviderHelper.GetControllerActionByContext(HttpContext.Current); var parameter = action.GetParameters().FirstOrDefault(p => p.Name == prefix); return(parameter != null && parameter.ParameterType == typeof(T)); } catch (AmbiguousMatchException) { return(false); } }
public override IValueProvider GetValueProvider(ControllerContext controllerContext) { try { var action = ValueProviderHelper.GetControllerActionByContext(HttpContext.Current); return(action.GetParameters().Any(p => p.ParameterType == typeof(ReportDepartmentAndResourceRightsOptions)) ? new ReportDepartmentAndResourceRightsOptionsValueProvider() : null); } catch (AmbiguousMatchException) { return(null); } }