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