Skip to content

Commit cf17f72

Browse files
author
Niall Brennan
committed
add array info
1 parent a1f3e9b commit cf17f72

File tree

1 file changed

+11
-0
lines changed
  • src/connections/sources/catalog/libraries/server/csharp

1 file changed

+11
-0
lines changed

src/connections/sources/catalog/libraries/server/csharp/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,17 @@ analytics.Reset()
326326
## Compatibility
327327
This library targets `.NET Standard 2.0`. See the [list of compatible platforms](https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0){:target="_blank"}.
328328
329+
## FAQ
330+
### Arrays
331+
To send an array as an event property you can reference the repo [here](https://github.com/segmentio/Serialization.NET/blob/main/Tests/JsonUtilityTest.cs#L24). For example, to send an array of strings the following code could be implemented:
332+
```c#
333+
List<string> listOfStrings = new List<string> { "test1", "test2", "test3" };
334+
335+
JsonObject customerJsonObj = new JsonObject
336+
{
337+
["event_name"] = new JsonArray(listOfStrings.ConvertAll(o => (JsonElement)o))
338+
};
339+
```
329340
## Changelog
330341
[View the Analytics-CSharp changelog on GitHub](https://github.com/segmentio/analytics-csharp/releases){:target="_blank"}.
331342

0 commit comments

Comments
 (0)