public static XlsRowBuilder GetAllProperties(object?o) { var rb = new XlsRowBuilder(); if (o == null) { throw new LPGException("object was null"); } var properties = o.GetType().GetProperties(); foreach (PropertyInfo property in properties) { var shouldIgnoreAttribute = Attribute.IsDefined(property, typeof(RowBuilderIgnoreAttribute)); if (shouldIgnoreAttribute) { continue; } object?val = property.GetValue(o); if (o is List <string> mylist) { val = string.Join(",", mylist); } rb.Add(property.Name, val); } return(rb); }
public static XlsRowBuilder Start([NotNull] string name, object?content) { var rb = new XlsRowBuilder(); return(rb.Add(name, content)); }