sdk/dotnet/src/Microsoft.Datasync.Client/Query/OData/QueryTokenKind.cs
/// <summary>
/// Converts a <see cref="QueryTokenKind"/> to a <see cref="BinaryOperatorKind"/> where possible.
/// </summary>
/// <param name="kind">The <see cref="QueryTokenKind"/> to convert</param>
/// <returns>The <see cref="BinaryOperatorKind"/> that is equivalent</returns>
/// <exception cref="InvalidOperationException">if the token kind cannot be converted.</exception>
Converts a  to a  where possible.
Converts a to a where possible .
internal static BinaryOperatorKind ToBinaryOperatorKind(this QueryTokenKind kind) => kind switch
        {
            QueryTokenKind.Add => BinaryOperatorKind.Add,
            QueryTokenKind.And => BinaryOperatorKind.And,
            QueryTokenKind.Or => BinaryOperatorKind.Or,
            QueryTokenKind.Equal => BinaryOperatorKind.Equal,
            QueryTokenKind.NotEqual => BinaryOperatorKind.NotEqual,
            QueryTokenKind.LessThan => BinaryOperatorKind.LessThan,
            QueryTokenKind.LessThanEqual => BinaryOperatorKind.LessThanOrEqual,
            QueryTokenKind.GreaterThan => BinaryOperatorKind.GreaterThan,
            QueryTokenKind.GreaterThanEqual => BinaryOperatorKind.GreaterThanOrEqual,
            QueryTokenKind.Subtract => BinaryOperatorKind.Subtract,
            QueryTokenKind.Multiply => BinaryOperatorKind.Multiply,
            QueryTokenKind.Divide => BinaryOperatorKind.Divide,
            QueryTokenKind.Modulo => BinaryOperatorKind.Modulo,
            _ => throw new InvalidOperationException("Unknown query token to binary operator conversion")
        };
internal static BinaryOperatorKind ToBinaryOperatorKind ( this QueryTokenKind kind ) => kind switch { QueryTokenKind . Add => BinaryOperatorKind . Add , QueryTokenKind . And => BinaryOperatorKind . And , QueryTokenKind . Or => BinaryOperatorKind . Or , QueryTokenKind . Equal => BinaryOperatorKind . Equal , QueryTokenKind . NotEqual => BinaryOperatorKind . NotEqual , QueryTokenKind . LessThan => BinaryOperatorKind . LessThan , QueryTokenKind . LessThanEqual => BinaryOperatorKind . LessThanOrEqual , QueryTokenKind . GreaterThan => BinaryOperatorKind . GreaterThan , QueryTokenKind . GreaterThanEqual => BinaryOperatorKind . GreaterThanOrEqual , QueryTokenKind . Subtract => BinaryOperatorKind . Subtract , QueryTokenKind . Multiply => BinaryOperatorKind . Multiply , QueryTokenKind . Divide => BinaryOperatorKind . Divide , QueryTokenKind . Modulo => BinaryOperatorKind . Modulo , _ => throw new InvalidOperationException ( " " ) } ;
Converts a  to a  where possible.
Converts a to a where possible .
The  that is equivalent
The that is equivalent
if the token kind cannot be converted.
if the token kind cannot be converted .
QueryTokenKind
this
kind
The  to convert
The to convert