public void Intercept(ICollection <Parameters.WebApiParameter> apiParams, ParameterInterceptorContext parameterInterceptorContext) { var fileParameters = apiParams.Where(p => (p.SqlName ?? "").Contains("_")) .Select(s => new { Parameter = s, FileParameterName = s.SqlName !.Substring(0, s.SqlName !.LastIndexOf('_')), Postfix = s.SqlName !.Substring(s.SqlName !.LastIndexOf('_') + 1) })
void IParameterInterceptor.Intercept(ICollection <Parameters.WebApiParameter> apiParams, ParameterInterceptorContext parameterInterceptorContext) { List <Parameters.WebApiParameter> toRemove = new List <Parameters.WebApiParameter>(); List <Parameters.WebApiParameter> toAdd = new List <Parameters.WebApiParameter>(); foreach (var param in apiParams) { if (param.SqlName != null && IsSystemParameter(param.SqlName)) { toRemove.Add(param); toAdd.Add(new Parameters.SystemParameter(param.SqlName, getFns[param.SqlName])); } } foreach (var i in toRemove) { apiParams.Remove(i); } foreach (var a in toAdd) { apiParams.Add(a); } }