private static bool IgnorThis(SupplierAddress target, string parentFilter) { bool result = true; parentFilter = parentFilter.Replace(" ", ""); // remove spaces parentFilter = parentFilter.Replace("'", ""); // remove ' string [] parsed = parentFilter.Split('='); // parse if (target.SupplierId == Guid.Empty) { PropertyInfo pi = target.GetType().GetProperty(parsed[0]); string filterField = (string)pi.GetValue(target, null); if (filterField.ToLower() == parsed[1].ToLower()) { result = false; } } else { SupplierAddress parentTemplate = SupplierAddress.Load(target.SupplierId); result = IgnorThis(parentTemplate, parentFilter); } return(result); }