using System.Collections.Generic;
public static void Main()
var obj = new { searchDuration = "200", txPowerLevel = "100", other = "123"};
var stringProperties = obj
.Where(pi => pi.PropertyType == typeof(string) && pi.GetGetMethod() != null)
Value = pi.GetGetMethod().Invoke(obj, null)}
var response = new Dictionary<string, string>()
{"searchDuration","200"},
{"optionalFilter","NO_FILTERS_ACTIVE_SCANNING"},
{"peripheralId","123wrong"}
foreach (var item in stringProperties)
response.TryGetValue(item.Name, out v);
Console.WriteLine(item.Name + ": obj value=" + item.Value + ", response value=" + (v ?? "--N/A--"));