<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.2" />

Microsoft.Data.SqlTypes.SqlJson

public class SqlJson : INullable
Represents the JSON datatype in SQL Server.
public static SqlJson Null { get; }

Represents a null instance of the SqlJson type. This instance is equivalent to calling the parameterless constructor, or calling the other constructors with a null value.

public bool IsNull { get; }

public string Value { get; }

Gets the serialized JSON string of this SqlJson instance.

public SqlJson()

Construct a new instance of the SqlJson class which represents a null JSON value.

public SqlJson(string jsonString)

Construct a new instance of the SqlJson class with a serialized JSON String. The string is validated by parsing it with JsonDocument.

public SqlJson(JsonDocument jsonDoc)

Construct a new instance of the SqlJson class with a JsonDocument. The serialized JSON string from the document is saved.