public OwinRequestData(RouteData routeData, OwinRequestBody body) { AddValues(new RouteDataValues(routeData)); AddValues(Querystring, new DictionaryKeyValues(body.Querystring())); AddValues(FormPost, new DictionaryKeyValues(body.FormData ?? new Dictionary <string, string>())); AddValues(RequestDataSource.Header.ToString(), new DictionaryKeyValues(body.Headers())); }
public OwinRequestData(RouteData routeData, OwinRequestBody body) { AddValues(new RouteDataValues(routeData)); AddValues("OwinQuerystring", new DictionaryKeyValues(body.Querystring())); AddValues("OwinFormPost", new DictionaryKeyValues(body.FormData ?? new Dictionary<string, string>())); AddValues(RequestDataSource.Header.ToString(), new DictionaryKeyValues(body.Headers())); }
public OwinAggregateDictionary(RouteData routeData, OwinRequestBody body) { Func <string, object> locator = key => { object found; routeData.Values.TryGetValue(key, out found); return(found); }; AddLocator(RequestDataSource.Route.ToString(), locator, () => routeData.Values.Keys); AddLocator(RequestDataSource.Request.ToString(), key => findRequestValue(key, body), () => valuesForRequest(body).Keys); addDictionaryLocator("Query string", body.Querystring()); addDictionaryLocator("Form Post", body.FormData ?? new Dictionary <string, string>()); addDictionaryLocator(RequestDataSource.Header.ToString(), body.Headers()); }
public OwinAggregateDictionary(RouteData routeData, OwinRequestBody body) { Func<string, object> locator = key => { object found; routeData.Values.TryGetValue(key, out found); return found; }; AddLocator(RequestDataSource.Route.ToString(), locator, () => routeData.Values.Keys); AddLocator(RequestDataSource.Request.ToString(), key => findRequestValue(key, body), () => valuesForRequest(body).Keys); addDictionaryLocator("Query string", body.Querystring()); addDictionaryLocator("Form Post", body.FormData ?? new Dictionary<string, string>()); addDictionaryLocator(RequestDataSource.Header.ToString(), body.Headers()); }
public OwinAggregateDictionary(RouteData routeData, OwinRequestBody body) { // TODO -- this is duplication w/ AspNetAggregateDictionary. DRY it baby! Func<string, object> locator = key => { object found; routeData.Values.TryGetValue(key, out found); return found; }; AddLocator(RequestDataSource.Route.ToString(), locator, () => routeData.Values.Keys); addDictionaryLocator("Query string", body.Querystring()); addDictionaryLocator("Form Post", body.FormData ?? new Dictionary<string, string>()); addDictionaryLocator(RequestDataSource.Header.ToString(), body.Headers()); }
public OwinAggregateDictionary(RouteData routeData, OwinRequestBody body) { // TODO -- this is duplication w/ AspNetAggregateDictionary. DRY it baby! Func <string, object> locator = key => { object found; routeData.Values.TryGetValue(key, out found); return(found); }; AddLocator(RequestDataSource.Route.ToString(), locator, () => routeData.Values.Keys); addDictionaryLocator("Query string", body.Querystring()); addDictionaryLocator("Form Post", body.FormData ?? new Dictionary <string, string>()); addDictionaryLocator(RequestDataSource.Header.ToString(), body.Headers()); }
private static IDictionary<string, string> valuesForRequest(OwinRequestBody body) { var dictionary = new Dictionary<string, string>(); var queryString = body.Querystring(); foreach(var key in queryString.Keys) { dictionary.Add(key, queryString[key]); } IDictionary<string, string> formData = body.FormData ?? new Dictionary<string, string>(); foreach (var key in formData.Keys.Where(x => x != null)) { if(!dictionary.ContainsKey(key)) { dictionary.Add(key, formData[key]); } } return dictionary; }
private static IDictionary <string, string> valuesForRequest(OwinRequestBody body) { var dictionary = new Dictionary <string, string>(); var queryString = body.Querystring(); foreach (var key in queryString.Keys) { dictionary.Add(key, queryString[key]); } IDictionary <string, string> formData = body.FormData ?? new Dictionary <string, string>(); foreach (var key in formData.Keys.Where(x => x != null)) { if (!dictionary.ContainsKey(key)) { dictionary.Add(key, formData[key]); } } return(dictionary); }