MarcosMeli / FileHelpers

The FileHelpers are a free and easy to use .NET library to read/write data from fixed length or delimited records in files, strings or streams
https://www.filehelpers.net
MIT License
1.13k stars 349 forks source link

Array of complex data into FixedLengthRecord - how ? #361

Open ch0mik opened 4 years ago

ch0mik commented 4 years ago

` [FixedLengthRecord(FixedMode.AllowLessChars)] public class Customer { [FieldFixedLength(5)] public int CustId;

[FieldFixedLength(30)]
[FieldTrim(TrimMode.Both)]
public string Name;

[FieldFixedLength(8)]
[FieldConverter(ConverterKind.DateMultiFormat, "ddMMyyyy", "MMyyyy")]
public DateTime AddedDate;

[???] public Address[] Adresses

}`

`[FixedLengthRecord(FixedMode.AllowLessChars)] public class Address { [FieldFixedLength(5)] public int AddId;

[FieldFixedLength(30)]
public string City;

[FieldFixedLength(30)]
public string Street;

[FieldFixedLength(8)]
public string Number;

}`

What I should make into Attributes for this part of class (array of Address[] class)

[???] public Address[] Adresses

ianpowell2017 commented 1 month ago

I found this useful when I had the problem https://github.com/MarcosMeli/FileHelpers/blob/ecc07e9e7942394f987af0cafd1ef6ca10a5ffe2/FileHelpers.Tests/Tests/Common/ArrayFields.cs#L536