Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Latest commit

 

History

History
16 lines (12 loc) · 728 Bytes

complex-list.md

File metadata and controls

16 lines (12 loc) · 728 Bytes

Lists

Lists provide a better alternative to repeatable fields so that they can store any data, unlike a repeatable field which can only repeat primitive data type values like an array does. You can put any type inside a list, for instance a structure:

var ds = new DataSet(
   new DataField<int>("id"),
   new ListField("cities",
   new StructField("element",
      new DataField<string>("name"),
      new DataField<string>("country"))));

ds.Add(1, new[] { new Row("London", "UK"), new Row("New York", "US") });

Everything else, including primitive types, maps, structures or even lists themselves can be used as a list member.