using System.ComponentModel;
public static void Main(string[] args)
bool IsRecalculationNeeded = false;
PolicyRule oldRule = new PolicyRule
isPartialParticipation = false,
PolicyRule newRule = new PolicyRule
isPartialParticipation = false,
PropertyInfo[] properties = typeof(PolicyRule).GetProperties()
.Where(prop => Attribute.IsDefined(prop, typeof(DescriptionAttribute))).ToArray();
foreach (PropertyInfo property in properties)
var attrLists = (DescriptionAttribute[])property.GetCustomAttributes(typeof(DescriptionAttribute), false);
var attr = attrLists.Where(obj => obj.Description == "WOT_CHANGES").FirstOrDefault();
IsRecalculationNeeded = property.GetValue(oldRule).ToString() != property.GetValue(newRule).ToString();
Console.WriteLine("PropName " + property.Name);
Console.WriteLine("Old PropValue "+ property.Name +" " +property.GetValue(oldRule));
Console.WriteLine("New PropValue "+property.Name +" " +property.GetValue(newRule));
Console.WriteLine("IsRecalculationNeeded "+IsRecalculationNeeded);
public string Name { get; set; }
[Description("WOT_CHANGES")]
public bool isPartialParticipation { get; set; }
[Description("WOT_CHANGES")]
public int Frequency { get; set; }