public IEnumerable <DelimitedColumn> GetDelimitedColumns() { foreach (var propertyInfo in CsvSerializerHelpers.OrderByProperty(this.type)) { var delimitedColumn = new DelimitedColumn() { Name = propertyInfo.Name, Type = propertyInfo.PropertyType, }; yield return(delimitedColumn); } }
public CsvSerializer() { this.type = typeof(T); this.propertyInfos = CsvSerializerHelpers.OrderByProperty(this.type) .ToArray(); this.propertySetters = this.propertyInfos.Select(CoercionHelpers.CreatePropertySetter <T>) .ToArray(); if (!this.IsDataContract()) { string message = $@"The type ""{this.type.FullName}"" does not have the [DataContract] attribute!"; throw new ArgumentException(message); } }