1 instantiation of DotNetObjectReference
Microsoft.JSInterop (1)
DotNetObjectReference.cs (1)
23
return new
DotNetObjectReference
<TValue>(value);
106 references to DotNetObjectReference
Aspire.Dashboard (3)
Components\Controls\Chart\PlotlyChart.razor.cs (1)
38
private
DotNetObjectReference
<ChartInterop>? _chartInteropReference;
Components\Layout\MainLayout.razor.cs (2)
25
private
DotNetObjectReference
<ShortcutManager>? _shortcutManagerReference;
26
private
DotNetObjectReference
<MainLayout>? _layoutReference;
BasicTestApp (34)
EventCustomArgsTypes.cs (1)
36
public
DotNetObjectReference
<DotNetType> DotNetObject { get; set; }
InteropTest\JavaScriptInterop.cs (31)
51
DotNetObjectReference
<TestDTO> parameter3)
60
DotNetObjectReference
<TestDTO> parameter3,
70
DotNetObjectReference
<TestDTO> parameter3,
81
DotNetObjectReference
<TestDTO> parameter3,
93
DotNetObjectReference
<TestDTO> parameter3,
106
DotNetObjectReference
<TestDTO> parameter3,
140
DotNetObjectReference
<TestDTO> parameter3)
149
DotNetObjectReference
<TestDTO> parameter3,
159
DotNetObjectReference
<TestDTO> parameter3,
169
DotNetObjectReference
<TestDTO> parameter3,
180
DotNetObjectReference
<TestDTO> parameter3,
193
DotNetObjectReference
<TestDTO> parameter3,
230
DotNetObjectReference
<TestDTO> parameter3)
240
DotNetObjectReference
<TestDTO> parameter3,
251
DotNetObjectReference
<TestDTO> parameter3,
263
DotNetObjectReference
<TestDTO> parameter3,
276
DotNetObjectReference
<TestDTO> parameter3,
290
DotNetObjectReference
<TestDTO> parameter3,
325
DotNetObjectReference
<TestDTO> parameter3)
334
DotNetObjectReference
<TestDTO> parameter3,
344
DotNetObjectReference
<TestDTO> parameter3,
354
DotNetObjectReference
<TestDTO> parameter3,
366
DotNetObjectReference
<TestDTO> parameter3,
379
DotNetObjectReference
<TestDTO> parameter3,
390
public static Dictionary<string,
DotNetObjectReference
<TestDTO>> ReturnDotNetObjectByRef()
392
return new Dictionary<string,
DotNetObjectReference
<TestDTO>>
399
public static async Task<Dictionary<string,
DotNetObjectReference
<TestDTO>>> ReturnDotNetObjectByRefAsync()
402
return new Dictionary<string,
DotNetObjectReference
<TestDTO>>
409
public static int ExtractNonSerializedValue(
DotNetObjectReference
<TestDTO> objectByRef)
490
public
DotNetObjectReference
<TestDTO> DTOByRef { get; set; }
501
public
DotNetObjectReference
<TestDTO> OutgoingByRef { get; set; }
ServerReliability\JSInterop.cs (2)
11
public static
DotNetObjectReference
<ImportantInformation> CreateImportant()
17
public static string ReceiveTrivial(
DotNetObjectReference
<TrivialInformation> information)
Microsoft.AspNetCore.Components.Web (3)
Virtualization\VirtualizeJsInterop.cs (1)
17
private
DotNetObjectReference
<VirtualizeJsInterop>? _selfReference;
WebRenderer.cs (2)
22
private readonly
DotNetObjectReference
<WebRendererInteropMethods> _interopMethodsReference;
131
newJsonOptions.TypeInfoResolverChain.Add(JsonConverterFactoryTypeInfoResolver<
DotNetObjectReference
<WebRendererInteropMethods>>.Instance);
Microsoft.JSInterop (16)
DotNetObjectReference.cs (4)
10
/// Provides convenience methods to produce a <see cref="
DotNetObjectReference
{TValue}" />.
15
/// Creates a new instance of <see cref="
DotNetObjectReference
{TValue}" />.
18
/// <returns>An instance of <see cref="
DotNetObjectReference
{TValue}" />.</returns>
19
public static
DotNetObjectReference
<TValue> Create<[DynamicallyAccessedMembers(JSInvokable)] TValue>(TValue value) where TValue : class
DotNetObjectReferenceOfT.cs (1)
26
/// Initializes a new instance of <see cref="
DotNetObjectReference
{TValue}" />.
Infrastructure\DotNetDispatcher.cs (1)
275
return !parameterType.IsGenericType || parameterType.GetGenericTypeDefinition() != typeof(
DotNetObjectReference
<>);
Infrastructure\DotNetObjectReferenceJsonConverter.cs (5)
11
internal sealed class DotNetObjectReferenceJsonConverter<[DynamicallyAccessedMembers(JSInvokable)] TValue> : JsonConverter<
DotNetObjectReference
<TValue>> where TValue : class
22
public override
DotNetObjectReference
<TValue> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
51
var
value = (
DotNetObjectReference
<TValue>)JSRuntime.GetObjectReference(dotNetObjectId);
55
public override void Write(Utf8JsonWriter writer,
DotNetObjectReference
<TValue> value, JsonSerializerOptions options)
Infrastructure\DotNetObjectReferenceJsonConverterFactory.cs (1)
21
return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(
DotNetObjectReference
<>);
JSRuntime.cs (4)
295
internal long TrackObjectReference<[DynamicallyAccessedMembers(JSInvokable)] TValue>(
DotNetObjectReference
<TValue> dotNetObjectReference) where TValue : class
314
$" A common cause is caching an instance of {nameof(
DotNetObjectReference
<TValue>)} globally. Consider creating instances of {nameof(
DotNetObjectReference
<TValue>)} at the JSInterop callsite.");
332
/// <param name="dotNetObjectId">The ID of the <see cref="
DotNetObjectReference
{TValue}"/>.</param>
Microsoft.JSInterop.Tests (50)
DotNetObjectReferenceTest.cs (7)
20
var
objRef = DotNetObjectReference.Create(new object());
35
var
objRef = DotNetObjectReference.Create(new object());
49
var
objRef = DotNetObjectReference.Create("Hello world");
50
var expected = $"{objRef.GetType().Name} is already being tracked by a different instance of {nameof(JSRuntime)}. A common cause is caching an instance of {nameof(
DotNetObjectReference
<string>)}" +
51
$" globally. Consider creating instances of {nameof(
DotNetObjectReference
<string>)} at the JSInterop callsite.";
67
var
objRef = DotNetObjectReference.Create("Hello world");
86
var
objRef = DotNetObjectReference.Create("Hello world");
Infrastructure\DotNetDispatcherTest.cs (20)
117
var
objectRef = DotNetObjectReference.Create(arg3);
145
var resultDto2 = Assert.IsType<
DotNetObjectReference
<TestDTO>>(jsRuntime.GetObjectReference(property.GetInt64())).Value;
157
var
objectRef = DotNetObjectReference.Create(arg3);
180
var
objectRef = DotNetObjectReference.Create(targetInstance);
197
var
objectRef = DotNetObjectReference.Create(targetInstance);
214
var
objectRef = DotNetObjectReference.Create(targetInstance);
233
var
objectRef = DotNetObjectReference.Create(targetInstance);
252
var
objectRef = DotNetObjectReference.Create(targetInstance);
462
var resultDto = ((
DotNetObjectReference
<TestDTO>)jsRuntime.GetObjectReference(3)).Value;
564
var
objectRef = DotNetObjectReference.Create(new TestDTO { IntVal = 4 });
589
var
arg1Ref = DotNetObjectReference.Create(targetInstance);
590
var
arg2Ref = DotNetObjectReference.Create(arg2);
628
var
arg1Ref = DotNetObjectReference.Create(targetInstance);
629
var
arg2Ref = DotNetObjectReference.Create(arg2);
657
var
arg1Ref = DotNetObjectReference.Create(targetInstance);
878
public static object[] MyInvocableWithParams(TestDTO dtoViaJson, int[] incrementAmounts,
DotNetObjectReference
<TestDTO> dtoByRef)
908
public object[] InvokableInstanceMethod(string someString,
DotNetObjectReference
<TestDTO> someDTORef)
925
public async Task<InvokableAsyncMethodResult> InvokableAsyncMethod(TestDTO dtoViaJson,
DotNetObjectReference
<TestDTO> dtoByRefWrapper)
945
public async ValueTask<InvokableAsyncMethodResult> InvokableAsyncMethodReturningValueTask(TestDTO dtoViaJson,
DotNetObjectReference
<TestDTO> dtoByRefWrapper)
973
public
DotNetObjectReference
<TestDTO> SomeDTORef { get; set; }
Infrastructure\DotNetObjectReferenceJsonConverterTest.cs (18)
18
var
dotNetObjectRef = DotNetObjectReference.Create(new TestModel());
23
var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions));
32
var
dotNetObjectRef = DotNetObjectReference.Create(new TestModel());
37
var ex = Assert.Throws<JsonException>(() => JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions));
46
var
dotNetObjectRef = DotNetObjectReference.Create(input);
52
var ex = Record.Exception(() => JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions));
61
var
dotNetObjectRef = DotNetObjectReference.Create(input);
67
var ex = Record.Exception(() => JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions));
76
var
dotNetObjectRef = DotNetObjectReference.Create(input);
82
var
deserialized = JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions)!;
96
var
ref1 = DotNetObjectReference.Create(instance1);
97
var
ref2 = DotNetObjectReference.Create(instance2);
102
var deserialized = JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>[]>(json, JsonSerializerOptions)!;
114
var
dotNetObjectRef = DotNetObjectReference.Create(input);
123
var
deserialized = JsonSerializer.Deserialize<
DotNetObjectReference
<TestModel>>(json, JsonSerializerOptions)!;
134
var
dotNetObjectRef = DotNetObjectReference.Create(new TestModel());
JSInProcessRuntimeTest.cs (3)
41
var
syncResult = runtime.Invoke<
DotNetObjectReference
<object>>("test identifier",
75
var syncResult = runtime.Invoke<
DotNetObjectReference
<object>[]>(
JSRuntimeTest.cs (2)
271
var
obj1Ref = DotNetObjectReference.Create(obj1);
272
var
obj1DifferentRef = DotNetObjectReference.Create(obj1);