/// <inheritdoc /> public ISqlColumnType GetCommonType(ISqlColumnType left, ISqlColumnType right) { if (!(left is MsSqlColumnType leftType && right is MsSqlColumnType rightType)) { throw new InvalidOperationException($"Cannot decide the common type as one of the types is not MS SQL type: {left.GetType()}, {right.GetType()}"); }
/// <inheritdoc /> public void WriteCastedExpression(ISqlColumnType actualType, ISqlColumnType expectedType, Action writeExpressionFunc) { if (!actualType.Equals(expectedType)) { _sb.Append("CAST("); writeExpressionFunc(); _sb.Append(" AS "); if (!(expectedType is MsSqlColumnType columnType)) { throw new InvalidOperationException($"Trying to cast to a type that is not specific to MS SQL, type: {expectedType.GetType()}"); } else { _sb.Append(columnType.DbString); } _sb.Append(")"); }