src/AppMotor.Core/Extensions/TypeExtensions.cs
/// <summary>
/// Returns the <see cref="MethodInfo"/> for the specified custom binary (i.e. two parameters/operands) operator
/// defined in this type. This method assumes that both operands are of this type. Returns <c>null</c>, if the
/// operator method doesn't exist.
/// </summary>
/// <param name="type"></param>
/// <param name="operator">The operator</param>
Returns the  for the specified custom binary  operator
defined in this type. This method assumes that both operands are of this type. Returns null
Returns the for the specified custom binary operator defined in this type . This method assumes that both operands are of this type . Returns null
[MustUseReturnValue]
    public static MethodInfo? GetOperator(this Type type, BinaryOperators @operator)
    {
        switch (@operator)
        {
            case BinaryOperators.LeftShift:
            case BinaryOperators.RightShift:
                return type.GetOperator(@operator, otherType: typeof(int));
            default:
                return type.GetOperator(@operator, otherType: type);
        }
    }
[ MustUseReturnValue ] public static MethodInfo ? GetOperator ( this Type type , BinaryOperators @operator ) { switch ( @operator ) { case BinaryOperators . LeftShift : case BinaryOperators . RightShift : return type . GetOperator ( @operator , otherType : typeof ( int ) ) ; default : return type . GetOperator ( @operator , otherType : type ) ; } }
Returns the  for the specified custom binary (i.e.
Returns the for the specified custom binary ( i . e .
Type
this
@operator
BinaryOperators
type
None
operator
None