private void AppendProduct(ProductDBModel product, ref StringBuilder sb) { foreach (PropertyInfo pi in product.GetType().GetProperties()) { var val = pi.GetValue(product) ?? string.Empty; AppendCell(sb, val.ToString()); } sb.Remove(sb.Length - 1, 1); }