public static StrObjectDict HttpDataToDict(this HttpRequestBase request, bool emptyAsKey) { //return new StrObjectDict().Merger(request.Form); if (request.ContentType.IndexOf("application/json") > -1) { try { StreamReader reader = new StreamReader(request.InputStream, request.ContentEncoding); string req = reader.ReadToEnd(); object oi = JsonAdapter.FromJsonAsDictionary(req); return(StrObjectDict.FromVariable(oi, emptyAsKey)); } catch (Exception) { throw; } } var o = StrObjectDict.FromVariable(request.Form, emptyAsKey); StrObjectDict sod = new StrObjectDict(); sod.Add("Params", o.Merger(request.QueryString)); return(sod); }
public static StrObjectDict FromVariable(object o, bool nullValueAsKey) { return(StrObjectDict.FromVariable(o, nullValueAsKey, ECase.NORMAL)); }
public static StrObjectDict FromVariable(object o) { return(StrObjectDict.FromVariable(o, true)); }
public static StrObjectDict toStrObjDict(this object o, bool nullValueAsKey) { //Dictionary<string, object> dictionary = new Dictionary<string, object>(); //return dictionary.Merger(o, nullValueAsKey) ; return(StrObjectDict.FromVariable(o, nullValueAsKey)); }
public static StrObjectDict toStrObjDict(this object o) { return(StrObjectDict.FromVariable(o)); }