Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions Orm/Xtensive.Orm/Orm/Configuration/LinqExtensionRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,30 @@
// Created by: Denis Krjuchkov
// Created: 2011.10.27

using System;
using System.Linq.Expressions;
using System.Reflection;
using Xtensive.Core;


namespace Xtensive.Orm.Configuration
{
/// <summary>
/// Registration entry for LINQ extension.
/// </summary>
public sealed class LinqExtensionRegistration
public readonly struct LinqExtensionRegistration
{
/// <summary>
/// Gets member this extension is intended for.
/// </summary>
public MemberInfo Member { get; private set; }
public MemberInfo Member { get; }

/// <summary>
/// Gets substitution that is performed when LINQ translator encouters <see cref="Member"/> access.
/// </summary>
public LambdaExpression Substitution { get; private set; }
public LambdaExpression Substitution { get; }

/// <summary>
/// Gets action that is performed when LINQ translator encouters <see cref="Member"/> access.
/// </summary>
public Func<MemberInfo, Expression, Expression[], Expression> Compiler { get; private set; }
public Func<MemberInfo, Expression, Expression[], Expression> Compiler { get; }


// Constructors
Expand Down Expand Up @@ -63,4 +60,4 @@ public LinqExtensionRegistration(MemberInfo member, Func<MemberInfo, Expression,
Compiler = compiler;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ internal partial class MemberCompilerProvider<T> : LockableBase, IMemberCompiler
private readonly Module module;
private readonly int metadataToken;

public bool Equals(CompilerKey other) => metadataToken == other.metadataToken
&& (ReferenceEquals(module, other.module) || module == other.module);
public bool Equals(CompilerKey other) => metadataToken == other.metadataToken && module == other.module;

public override bool Equals(object obj) => obj is CompilerKey other && Equals(other);

Expand Down