1
2
3
4
5
6
7
8
9
10
11
12
13
|
using RestSharp.Extensions.MonoHttp;
public static class ExQueryString
{
public static string GetQueryString(this object obj)
{
var properties = from p in obj.GetType().GetProperties()
where p.GetValue(obj, null) != null
select p.Name + "=" + HttpUtility.UrlEncode(p.GetValue(obj, null).ToString());
return string.Join("&", properties.ToArray());
}
}
|