using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
public partial class Client
private async Task<string> UrlParameterizeRequest(object src)
PropertyInfo[] props = t.GetProperties();
foreach (var prop in props)
if (prop.GetIndexParameters().Length == 0)
if (prop.GetValue(src) != null)
if (prop.PropertyType.IsEnum)
{ result += $"{prop.Name}={prop.GetValue(src).GetType().GetMember(prop.GetValue(src).ToString()).First().GetCustomAttribute<DisplayAttribute>().GetName()}&"; }
else { result += $"{prop.Name.ToLower()}={prop.GetValue(src)}&"; }
throw new NotSupportedException("Url Parameterization is not supported for indexed properties.");
result = (String.IsNullOrWhiteSpace(result)) ? result : result.Remove(result.Length - 1);