private void resolveArray(string name, object value, ref HttpRequestModel model, HttpOperation operation, FieldInfo fi) { if (!string.IsNullOrEmpty(name)) { IEnumerator enumerator = ((Array)value).GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.Current; if (!string.IsNullOrEmpty(current.ToString()) || (string.IsNullOrEmpty(current.ToString()) && !IgnoreWhenValueIsEmpty)) { model.AddQueryString(name + "[]", (current != null) ? current.ToString() : ""); } else { operation.Log("(HttpQueryStringAttribute)(OnRequestResolveModel) Query string part failed to add because the value is empty!", LogSeverity.WARNING); } } } finally { IDisposable disposable; if ((disposable = enumerator as IDisposable) != null) { disposable.Dispose(); } } } else { operation.Log("(HttpQueryStringAttribute)(OnRequestResolveModel) Query string part failed to add because the name is empty!", LogSeverity.WARNING); } }
private void resolve(string name, object value, ref HttpRequestModel model, HttpOperation operation, FieldInfo fi) { value = Convert.ChangeType(value, typeof(string)); if (!string.IsNullOrEmpty(name) && (!string.IsNullOrEmpty((string)value) || (string.IsNullOrEmpty((string)value) && !IgnoreWhenValueIsEmpty))) { model.AddQueryString(name, (value != null) ? value.ToString() : ""); } else { operation.Log("(HttpQueryStringAttribute)(OnRequestResolveModel) Query string part failed to add because the name is empty!", LogSeverity.WARNING); } }