using EventBus; namespace ActiveMQCommunication { static class PropertiesConverter { public static Dictionary PropertiesToDic(this Properties properties) { if (properties == null || properties.Count ==0) return null; Dictionary dic = new Dictionary(); foreach (var item in properties.Names) { dic[item] = properties[item]; } return dic; } public static string PropertiesToselector(this Properties properties) { if (properties == null || properties.Count == 0) return string.Empty; string s = ""; foreach(var val in properties.Names) { if(string.IsNullOrEmpty(s)) { s = $"{val} = {properties[val]}"; } else { s += $"and {val} = {properties[val]}"; } } return s; } } }