Beispiel #1
0
 /// <summary>
 /// Api执行之前
 /// 在此检测parameter的输入合理性
 /// 不合理可以抛出异常
 /// </summary>
 /// <param name="action">关联的Api行为</param>
 /// <param name="parameter">参数信息</param>
 public abstract void OnExecuting(ApiAction action, ApiParameter parameter);
Beispiel #2
0
 /// <summary>
 /// 获取参数的参数过滤器
 /// </summary>
 /// <param name="parameter">参数</param>
 /// <param name="index">索引</param>
 /// <returns></returns>
 private IEnumerable <ParameterFilterAttribute> GetParameterFilterAttributes(ApiParameter parameter, int index)
 {
     return(parameter.Info
            .GetCustomAttributes <ParameterFilterAttribute>(inherit: true)
            .Select(filter => filter.InitWith(index)));
 }