Skip to content

Commit

Permalink
Fix for linker errors
Browse files Browse the repository at this point in the history
  • Loading branch information
captainsafia committed Sep 12, 2024
1 parent 7019eda commit d91d59c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Components/Forms/src/FieldIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private static void ParseAccessor<T>(Expression<Func<T>> accessor, out object mo
// so, given that it embeds captured values such as "this". We could consider special-casing
// for "() => something.Member" and building a cache keyed by "something.GetType()" with values
// of type Func<object, object> so we can cheaply map from "something" to "something.Member".
var modelLambda = Expression.Lambda(memberExpression.Expression);
var modelLambda = Expression.Lambda(typeof(Func<object?>), memberExpression.Expression);
var modelLambdaCompiled = (Func<object?>)modelLambda.Compile();
var result = modelLambdaCompiled() ??
throw new ArgumentException("The provided expression must evaluate to a non-null value.");
Expand Down Expand Up @@ -201,7 +201,7 @@ static Func<object, object> CreateAccessor((Type model, MemberInfo member) arg)
private static object GetModelFromIndexer(Expression methodCallExpression)
{
object model;
var methodCallObjectLambda = Expression.Lambda(methodCallExpression!);
var methodCallObjectLambda = Expression.Lambda(typeof(Func<object?>), methodCallExpression!);
var methodCallObjectLambdaCompiled = (Func<object?>)methodCallObjectLambda.Compile();
var result = methodCallObjectLambdaCompiled();
if (result is null)
Expand Down
2 changes: 2 additions & 0 deletions src/SignalR/server/Core/src/DynamicHub.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
namespace Microsoft.AspNetCore.SignalR;

/// <summary>
/// A base class for SignalR hubs that use <c>dynamic</c> to represent client invocations.
/// </summary>
[RequiresDynamicCode("DynamicHub requires dynamic code generation to construct a call site.")]
public abstract class DynamicHub : Hub
{
private DynamicHubClients? _clients;
Expand Down
2 changes: 2 additions & 0 deletions src/SignalR/server/Core/src/DynamicHubClients.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.SignalR.Internal;

namespace Microsoft.AspNetCore.SignalR;

/// <summary>
/// A class that provides <c>dynamic</c> access to connections, including the one that sent the current invocation.
/// </summary>
[RequiresDynamicCodeAttribute("DynamicHubClient requires dynamic code generation to construct a call site.")]
public class DynamicHubClients
{
private readonly IHubCallerClients _clients;
Expand Down
2 changes: 2 additions & 0 deletions src/SignalR/server/Core/src/Internal/DynamicClientProxy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using System.Dynamic;

namespace Microsoft.AspNetCore.SignalR.Internal;
Expand All @@ -9,6 +10,7 @@ internal sealed class DynamicClientProxy : DynamicObject
{
private readonly IClientProxy _clientProxy;

[RequiresDynamicCodeAttribute("This constructor requires dynamic code generation to construct a call site.")]
public DynamicClientProxy(IClientProxy clientProxy)
{
_clientProxy = clientProxy;
Expand Down

0 comments on commit d91d59c

Please sign in to comment.