4 instantiations of JsonEncodedText
System.Text.Json (4)
System\Text\Json\JsonEncodedText.cs (4)
73
return new
JsonEncodedText
(Array.Empty<byte>());
120
return new
JsonEncodedText
(Array.Empty<byte>());
133
return new
JsonEncodedText
(JsonHelpers.EscapeValue(utf8Value, idx, encoder));
137
return new
JsonEncodedText
(utf8Value.ToArray());
298 references to JsonEncodedText
Microsoft.AspNetCore.Components (2)
BindConverter.cs (2)
1817
builder.Append(
JsonEncodedText
.Encode(elementFormatter(value[0], culture)?.ToString() ?? string.Empty).Value);
1823
builder.Append(
JsonEncodedText
.Encode(elementFormatter(value[i], culture)?.ToString() ?? string.Empty).Value);
Microsoft.AspNetCore.Components.Server (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
11
private static readonly
JsonEncodedText
IdProperty =
JsonEncodedText
.Encode("__internalId");
Microsoft.AspNetCore.Components.Web (162)
WebEventData\ChangeEventArgsReader.cs (2)
12
private static readonly
JsonEncodedText
ValueKey =
JsonEncodedText
.Encode("value");
WebEventData\ClipboardEventArgsReader.cs (2)
12
private static readonly
JsonEncodedText
TypeKey =
JsonEncodedText
.Encode("type");
WebEventData\DragEventArgsReader.cs (16)
12
private static readonly
JsonEncodedText
DataTransfer =
JsonEncodedText
.Encode("dataTransfer");
13
private static readonly
JsonEncodedText
DropEffect =
JsonEncodedText
.Encode("dropEffect");
14
private static readonly
JsonEncodedText
EffectAllowed =
JsonEncodedText
.Encode("effectAllowed");
15
private static readonly
JsonEncodedText
Files =
JsonEncodedText
.Encode("files");
16
private static readonly
JsonEncodedText
Items =
JsonEncodedText
.Encode("items");
17
private static readonly
JsonEncodedText
Types =
JsonEncodedText
.Encode("types");
18
private static readonly
JsonEncodedText
Kind =
JsonEncodedText
.Encode("kind");
19
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
WebEventData\ErrorEventArgsReader.cs (10)
12
private static readonly
JsonEncodedText
Message =
JsonEncodedText
.Encode("message");
13
private static readonly
JsonEncodedText
Colno =
JsonEncodedText
.Encode("colno");
14
private static readonly
JsonEncodedText
Filename =
JsonEncodedText
.Encode("filename");
15
private static readonly
JsonEncodedText
Lineno =
JsonEncodedText
.Encode("lineno");
16
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
WebEventData\FocusEventArgsReader.cs (2)
12
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
WebEventData\KeyboardEventArgsReader.cs (20)
12
private static readonly
JsonEncodedText
Key =
JsonEncodedText
.Encode("key");
13
private static readonly
JsonEncodedText
Code =
JsonEncodedText
.Encode("code");
14
private static readonly
JsonEncodedText
Location =
JsonEncodedText
.Encode("location");
15
private static readonly
JsonEncodedText
Repeat =
JsonEncodedText
.Encode("repeat");
16
private static readonly
JsonEncodedText
CtrlKey =
JsonEncodedText
.Encode("ctrlKey");
17
private static readonly
JsonEncodedText
ShiftKey =
JsonEncodedText
.Encode("shiftKey");
18
private static readonly
JsonEncodedText
AltKey =
JsonEncodedText
.Encode("altKey");
19
private static readonly
JsonEncodedText
MetaKey =
JsonEncodedText
.Encode("metaKey");
20
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
21
private static readonly
JsonEncodedText
IsComposing =
JsonEncodedText
.Encode("isComposing");
WebEventData\MouseEventArgsReader.cs (36)
12
private static readonly
JsonEncodedText
Detail =
JsonEncodedText
.Encode("detail");
13
private static readonly
JsonEncodedText
ScreenX =
JsonEncodedText
.Encode("screenX");
14
private static readonly
JsonEncodedText
ScreenY =
JsonEncodedText
.Encode("screenY");
15
private static readonly
JsonEncodedText
ClientX =
JsonEncodedText
.Encode("clientX");
16
private static readonly
JsonEncodedText
ClientY =
JsonEncodedText
.Encode("clientY");
17
private static readonly
JsonEncodedText
OffsetX =
JsonEncodedText
.Encode("offsetX");
18
private static readonly
JsonEncodedText
OffsetY =
JsonEncodedText
.Encode("offsetY");
19
private static readonly
JsonEncodedText
PageX =
JsonEncodedText
.Encode("pageX");
20
private static readonly
JsonEncodedText
PageY =
JsonEncodedText
.Encode("pageY");
21
private static readonly
JsonEncodedText
MovementX =
JsonEncodedText
.Encode("movementX");
22
private static readonly
JsonEncodedText
MovementY =
JsonEncodedText
.Encode("movementY");
23
private static readonly
JsonEncodedText
Button =
JsonEncodedText
.Encode("button");
24
private static readonly
JsonEncodedText
Buttons =
JsonEncodedText
.Encode("buttons");
25
private static readonly
JsonEncodedText
CtrlKey =
JsonEncodedText
.Encode("ctrlKey");
26
private static readonly
JsonEncodedText
ShiftKey =
JsonEncodedText
.Encode("shiftKey");
27
private static readonly
JsonEncodedText
AltKey =
JsonEncodedText
.Encode("altKey");
28
private static readonly
JsonEncodedText
MetaKey =
JsonEncodedText
.Encode("metaKey");
29
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
WebEventData\PointerEventArgsReader.cs (16)
12
private static readonly
JsonEncodedText
PointerId =
JsonEncodedText
.Encode("pointerId");
13
private static readonly
JsonEncodedText
Width =
JsonEncodedText
.Encode("width");
14
private static readonly
JsonEncodedText
Height =
JsonEncodedText
.Encode("height");
15
private static readonly
JsonEncodedText
Pressure =
JsonEncodedText
.Encode("pressure");
16
private static readonly
JsonEncodedText
TiltX =
JsonEncodedText
.Encode("tiltX");
17
private static readonly
JsonEncodedText
TiltY =
JsonEncodedText
.Encode("tiltY");
18
private static readonly
JsonEncodedText
PointerType =
JsonEncodedText
.Encode("pointerType");
19
private static readonly
JsonEncodedText
IsPrimary =
JsonEncodedText
.Encode("isPrimary");
WebEventData\ProgressEventArgReader.cs (8)
12
private static readonly
JsonEncodedText
LengthComputable =
JsonEncodedText
.Encode("lengthComputable");
13
private static readonly
JsonEncodedText
Loaded =
JsonEncodedText
.Encode("loaded");
14
private static readonly
JsonEncodedText
Total =
JsonEncodedText
.Encode("total");
15
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
WebEventData\TouchEventArgsReader.cs (32)
12
private static readonly
JsonEncodedText
Detail =
JsonEncodedText
.Encode("detail");
13
private static readonly
JsonEncodedText
ClientX =
JsonEncodedText
.Encode("clientX");
14
private static readonly
JsonEncodedText
ClientY =
JsonEncodedText
.Encode("clientY");
15
private static readonly
JsonEncodedText
PageX =
JsonEncodedText
.Encode("pageX");
16
private static readonly
JsonEncodedText
PageY =
JsonEncodedText
.Encode("pageY");
17
private static readonly
JsonEncodedText
ScreenX =
JsonEncodedText
.Encode("screenX");
18
private static readonly
JsonEncodedText
ScreenY =
JsonEncodedText
.Encode("screenY");
19
private static readonly
JsonEncodedText
CtrlKey =
JsonEncodedText
.Encode("ctrlKey");
20
private static readonly
JsonEncodedText
ShiftKey =
JsonEncodedText
.Encode("shiftKey");
21
private static readonly
JsonEncodedText
AltKey =
JsonEncodedText
.Encode("altKey");
22
private static readonly
JsonEncodedText
MetaKey =
JsonEncodedText
.Encode("metaKey");
23
private static readonly
JsonEncodedText
Type =
JsonEncodedText
.Encode("type");
24
private static readonly
JsonEncodedText
Identifier =
JsonEncodedText
.Encode("identifier");
25
private static readonly
JsonEncodedText
ChangedTouches =
JsonEncodedText
.Encode("changedTouches");
26
private static readonly
JsonEncodedText
TargetTouches =
JsonEncodedText
.Encode("targetTouches");
27
private static readonly
JsonEncodedText
Touches =
JsonEncodedText
.Encode("touches");
WebEventData\WebEventDescriptorReader.cs (10)
13
private static readonly
JsonEncodedText
EventHandlerIdKey =
JsonEncodedText
.Encode("eventHandlerId");
14
private static readonly
JsonEncodedText
EventNameKey =
JsonEncodedText
.Encode("eventName");
15
private static readonly
JsonEncodedText
EventFieldInfoKey =
JsonEncodedText
.Encode("eventFieldInfo");
16
private static readonly
JsonEncodedText
ComponentIdKey =
JsonEncodedText
.Encode("componentId");
17
private static readonly
JsonEncodedText
FieldValueKey =
JsonEncodedText
.Encode("fieldValue");
WebEventData\WheelEventArgsReader.cs (8)
12
private static readonly
JsonEncodedText
DeltaX =
JsonEncodedText
.Encode("deltaX");
13
private static readonly
JsonEncodedText
DeltaY =
JsonEncodedText
.Encode("deltaY");
14
private static readonly
JsonEncodedText
DeltaZ =
JsonEncodedText
.Encode("deltaZ");
15
private static readonly
JsonEncodedText
DeltaMode =
JsonEncodedText
.Encode("deltaMode");
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
11
private static readonly
JsonEncodedText
IdProperty =
JsonEncodedText
.Encode("__internalId");
Microsoft.AspNetCore.Components.WebView (2)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (2)
11
private static readonly
JsonEncodedText
IdProperty =
JsonEncodedText
.Encode("__internalId");
Microsoft.AspNetCore.Http.Abstractions.Tests (5)
ProblemDetailsJsonConverterTest.cs (5)
175
var expected = $"{{\"type\":\"{
JsonEncodedText
.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status},\"detail\":\"{value.Detail}\",\"instance\":\"{
JsonEncodedText
.Encode(value.Instance)}\",\"traceId\":\"{traceId}\",\"some-data\":[\"value1\",\"value2\"]}}";
199
var expected = $"{{\"type\":\"{
JsonEncodedText
.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status}}}";
230
var expected = $"{{\"type\":\"{
JsonEncodedText
.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status},\"detail\":\"{value.Detail}\",\"instance\":\"{
JsonEncodedText
.Encode(value.Instance)}\",\"traceId\":null,\"some-data\":[\"value1\",\"value2\"]}}";
Microsoft.AspNetCore.Http.Connections.Common (20)
NegotiateProtocol.cs (20)
20
private static readonly
JsonEncodedText
ConnectionIdPropertyNameBytes =
JsonEncodedText
.Encode(ConnectionIdPropertyName);
22
private static readonly
JsonEncodedText
ConnectionTokenPropertyNameBytes =
JsonEncodedText
.Encode(ConnectionTokenPropertyName);
24
private static readonly
JsonEncodedText
UrlPropertyNameBytes =
JsonEncodedText
.Encode(UrlPropertyName);
26
private static readonly
JsonEncodedText
AccessTokenPropertyNameBytes =
JsonEncodedText
.Encode(AccessTokenPropertyName);
28
private static readonly
JsonEncodedText
AvailableTransportsPropertyNameBytes =
JsonEncodedText
.Encode(AvailableTransportsPropertyName);
30
private static readonly
JsonEncodedText
TransportPropertyNameBytes =
JsonEncodedText
.Encode(TransportPropertyName);
32
private static readonly
JsonEncodedText
TransferFormatsPropertyNameBytes =
JsonEncodedText
.Encode(TransferFormatsPropertyName);
34
private static readonly
JsonEncodedText
ErrorPropertyNameBytes =
JsonEncodedText
.Encode(ErrorPropertyName);
36
private static readonly
JsonEncodedText
NegotiateVersionPropertyNameBytes =
JsonEncodedText
.Encode(NegotiateVersionPropertyName);
38
private static readonly
JsonEncodedText
StatefulReconnectPropertyNameBytes =
JsonEncodedText
.Encode(StatefulReconnectPropertyName);
Microsoft.AspNetCore.SignalR.Common (8)
Protocol\HandshakeProtocol.cs (8)
21
private static readonly
JsonEncodedText
ProtocolPropertyNameBytes =
JsonEncodedText
.Encode(ProtocolPropertyName);
23
private static readonly
JsonEncodedText
ProtocolVersionPropertyNameBytes =
JsonEncodedText
.Encode(ProtocolVersionPropertyName);
25
private static readonly
JsonEncodedText
ErrorPropertyNameBytes =
JsonEncodedText
.Encode(ErrorPropertyName);
27
private static readonly
JsonEncodedText
TypePropertyNameBytes =
JsonEncodedText
.Encode(TypePropertyName);
Microsoft.AspNetCore.SignalR.Protocols.Json (22)
Protocol\JsonHubProtocol.cs (22)
27
private static readonly
JsonEncodedText
ResultPropertyNameBytes =
JsonEncodedText
.Encode(ResultPropertyName);
29
private static readonly
JsonEncodedText
ItemPropertyNameBytes =
JsonEncodedText
.Encode(ItemPropertyName);
31
private static readonly
JsonEncodedText
InvocationIdPropertyNameBytes =
JsonEncodedText
.Encode(InvocationIdPropertyName);
33
private static readonly
JsonEncodedText
StreamIdsPropertyNameBytes =
JsonEncodedText
.Encode(StreamIdsPropertyName);
35
private static readonly
JsonEncodedText
TypePropertyNameBytes =
JsonEncodedText
.Encode(TypePropertyName);
37
private static readonly
JsonEncodedText
ErrorPropertyNameBytes =
JsonEncodedText
.Encode(ErrorPropertyName);
39
private static readonly
JsonEncodedText
AllowReconnectPropertyNameBytes =
JsonEncodedText
.Encode(AllowReconnectPropertyName);
41
private static readonly
JsonEncodedText
TargetPropertyNameBytes =
JsonEncodedText
.Encode(TargetPropertyName);
43
private static readonly
JsonEncodedText
ArgumentsPropertyNameBytes =
JsonEncodedText
.Encode(ArgumentsPropertyName);
45
private static readonly
JsonEncodedText
HeadersPropertyNameBytes =
JsonEncodedText
.Encode(HeadersPropertyName);
47
private static readonly
JsonEncodedText
SequenceIdPropertyNameBytes =
JsonEncodedText
.Encode(SequenceIdPropertyName);
Microsoft.JSInterop (11)
Implementation\JSObjectReferenceJsonWorker.cs (2)
16
internal static readonly
JsonEncodedText
JSObjectIdKey =
JsonEncodedText
.Encode("__jsObjectId");
Infrastructure\ByteArrayJsonConverter.cs (2)
14
internal static readonly
JsonEncodedText
ByteArrayRefKey =
JsonEncodedText
.Encode("__byte[]");
Infrastructure\DotNetDispatcher.cs (2)
27
internal static readonly
JsonEncodedText
DotNetObjectRefKey =
JsonEncodedText
.Encode("__dotNetObject");
Infrastructure\DotNetObjectReferenceJsonConverter.cs (1)
18
private static
JsonEncodedText
DotNetObjectRefKey => DotNetDispatcher.DotNetObjectRefKey;
Infrastructure\DotNetStreamReferenceJsonConverter.cs (2)
11
private static readonly
JsonEncodedText
DotNetStreamRefKey =
JsonEncodedText
.Encode("__dotNetStream");
Infrastructure\JSStreamReferenceJsonConverter.cs (2)
12
private static readonly
JsonEncodedText
_jsStreamReferenceLengthKey =
JsonEncodedText
.Encode("__jsStreamReferenceLength");
System.Text.Json (62)
System\Text\Json\JsonEncodedText.cs (15)
17
public readonly struct JsonEncodedText : IEquatable<
JsonEncodedText
>
51
public static
JsonEncodedText
Encode(string value, JavaScriptEncoder? encoder = null)
69
public static
JsonEncodedText
Encode(ReadOnlySpan<char> value, JavaScriptEncoder? encoder = null)
79
private static
JsonEncodedText
TranscodeAndEncode(ReadOnlySpan<char> value, JavaScriptEncoder? encoder)
96
JsonEncodedText
encodedText = EncodeHelper(utf8Bytes, encoder);
116
public static
JsonEncodedText
Encode(ReadOnlySpan<byte> utf8Value, JavaScriptEncoder? encoder = null)
127
private static
JsonEncodedText
EncodeHelper(ReadOnlySpan<byte> utf8Value, JavaScriptEncoder? encoder)
142
/// Determines whether this instance and another specified <see cref="
JsonEncodedText
"/> instance have the same value.
145
/// Default instances of <see cref="
JsonEncodedText
"/> are treated as equal.
147
public bool Equals(
JsonEncodedText
other)
160
/// Determines whether this instance and a specified object, which must also be a <see cref="
JsonEncodedText
"/> instance, have the same value.
167
if (obj is
JsonEncodedText
encodedText)
178
/// Returns an empty string on a default instance of <see cref="
JsonEncodedText
"/>.
187
/// Returns the hash code for this <see cref="
JsonEncodedText
"/>.
190
/// Returns 0 on a default instance of <see cref="
JsonEncodedText
"/>.
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (7)
45
private readonly ConcurrentDictionary<ulong,
JsonEncodedText
> _nameCacheForWriting;
73
JsonEncodedText
encodedName =
JsonEncodedText
.Encode(fieldInfo.JsonName, encoder);
139
if (_nameCacheForWriting.TryGetValue(key, out
JsonEncodedText
formatted))
151
formatted =
JsonEncodedText
.Encode(stringValue, options.Encoder);
199
if (dictionaryKeyPolicy is null && _nameCacheForWriting.TryGetValue(key, out
JsonEncodedText
formatted))
212
formatted =
JsonEncodedText
.Encode(stringValue, options.Encoder);
System\Text\Json\Serialization\JsonSerializer.Write.HandleMetadata.cs (10)
12
internal static readonly
JsonEncodedText
s_metadataId =
JsonEncodedText
.Encode(IdPropertyName, encoder: null);
13
internal static readonly
JsonEncodedText
s_metadataRef =
JsonEncodedText
.Encode(RefPropertyName, encoder: null);
14
internal static readonly
JsonEncodedText
s_metadataType =
JsonEncodedText
.Encode(TypePropertyName, encoder: null);
15
internal static readonly
JsonEncodedText
s_metadataValues =
JsonEncodedText
.Encode(ValuesPropertyName, encoder: null);
39
JsonEncodedText
propertyName =
40
state.PolymorphicTypeResolver.CustomTypeDiscriminatorPropertyNameJsonEncoded is
JsonEncodedText
customPropertyName
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (2)
92
CustomTypeDiscriminatorPropertyNameJsonEncoded =
JsonEncodedText
.Encode(propertyName, options.Encoder);
117
public
JsonEncodedText
? CustomTypeDiscriminatorPropertyNameJsonEncoded { get; }
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
596
public void WriteStartArray(
JsonEncodedText
propertyName)
610
public void WriteStartObject(
JsonEncodedText
propertyName)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (1)
20
public void WriteBase64String(
JsonEncodedText
propertyName, ReadOnlySpan<byte> bytes)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (2)
22
/// The property name should already be escaped when the instance of <see cref="
JsonEncodedText
"/> was created.
24
public void WriteString(
JsonEncodedText
propertyName, DateTime value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (1)
23
public void WriteString(
JsonEncodedText
propertyName, DateTimeOffset value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (1)
23
public void WriteNumber(
JsonEncodedText
propertyName, decimal value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (1)
23
public void WriteNumber(
JsonEncodedText
propertyName, double value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (1)
23
public void WriteNumber(
JsonEncodedText
propertyName, float value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (1)
71
internal void WriteNumber(
JsonEncodedText
propertyName, ReadOnlySpan<byte> utf8FormattedNumber)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (1)
23
public void WriteString(
JsonEncodedText
propertyName, Guid value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (2)
20
public void WriteNull(
JsonEncodedText
propertyName)
141
public void WriteBoolean(
JsonEncodedText
propertyName, bool value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (2)
23
public void WriteNumber(
JsonEncodedText
propertyName, long value)
122
public void WriteNumber(
JsonEncodedText
propertyName, int value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (10)
19
public void WritePropertyName(
JsonEncodedText
propertyName)
426
public void WriteString(
JsonEncodedText
propertyName,
JsonEncodedText
value)
456
public void WriteString(string propertyName,
JsonEncodedText
value)
570
/// as if <see cref="WriteNull(System.Text.Json.
JsonEncodedText
)"/> was called.
573
public void WriteString(
JsonEncodedText
propertyName, string? value)
599
public void WriteString(
JsonEncodedText
propertyName, ReadOnlySpan<char> value)
689
public void WriteString(
JsonEncodedText
propertyName, ReadOnlySpan<byte> utf8Value)
779
public void WriteString(ReadOnlySpan<char> propertyName,
JsonEncodedText
value)
851
public void WriteString(ReadOnlySpan<byte> utf8PropertyName,
JsonEncodedText
value)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (2)
24
public void WriteNumber(
JsonEncodedText
propertyName, ulong value)
127
public void WriteNumber(
JsonEncodedText
propertyName, uint value)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (1)
18
public void WriteStringValue(
JsonEncodedText
value)