Created
February 2, 2023 11:26
-
-
Save gistlyn/031775083362f86b6973a96c1aa94bc3 to your computer and use it in GitHub Desktop.
json-empty-lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>net6.0</TargetFramework> | |
<Nullable>enable</Nullable> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<OutputType>Exe</OutputType> | |
<NoWarn>1591</NoWarn> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="ServiceStack.Common" Version="6.*" /> | |
</ItemGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ServiceStack; | |
using ServiceStack.Text; | |
Console.WriteLine(new Test().ToJson()); //Prints {"List":[]} | |
public class Test | |
{ | |
public List<string> List { get; set; } = new(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment