Beispiel #1
0
 /// <summary>
 ///     Returns the distance between g1 and g2, measured in the length unit of the spatial reference system
 ///     (SRS) of the geometry arguments.
 ///     For MySQL 8, this is equivalent of calling ST_Distance() when using an SRID of `0`.
 ///     For MySQL &lt; 8 and MariaDB, this is equivalent of calling ST_Distance() with any SRID.
 /// </summary>
 /// <param name="_">The DbFunctions instance.</param>
 /// <param name="g1">First geometry argument.</param>
 /// <param name="g2">Second geometry argument.</param>
 /// <returns>Distance betweeen g1 and g2.</returns>
 public static double SpatialDistancePlanar(
     [CanBeNull] this DbFunctions _,
     Geometry g1,
     Geometry g2)
 {
     throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(SpatialDistancePlanar)));
 }
Beispiel #2
0
 /// <summary>
 ///     Returns the mimimum spherical distance between Point or MultiPoint arguments on a sphere in meters,
 ///     by using the specified algorithm.
 ///     It is assumed that `g1` and `g2` are associated with an SRID of `4326`.
 /// </summary>
 /// <param name="_">The DbFunctions instance.</param>
 /// <param name="g1">First geometry argument.</param>
 /// <param name="g2">Second geometry argument.</param>
 /// <param name="algorithm">The algorithm to use. Must be directly supplied as a constant.</param>
 /// <returns>Distance betweeen g1 and g2.</returns>
 public static double SpatialDistanceSphere(
     [CanBeNull] this DbFunctions _,
     Geometry g1,
     Geometry g2,
     SpatialDistanceAlgorithm algorithm)
 {
     throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(SpatialDistanceSphere)));
 }
        public void IsDate_should_throw_on_client_eval()
        {
            var exIsDate = Assert.Throws <InvalidOperationException>(() => EF.Functions.IsDate("#ISDATE#"));

            Assert.Equal(
                MySqlStrings.FunctionOnClient(nameof(MySqlDbFunctionsExtensions.IsDate)),
                exIsDate.Message);
        }
        public void Contains_should_throw_on_client_eval()
        {
            var exNoLang = Assert.Throws <InvalidOperationException>(() => EF.Functions.Contains("teststring", "teststring"));

            Assert.Equal(
                MySqlStrings.FunctionOnClient(nameof(MySqlDbFunctionsExtensions.Contains)),
                exNoLang.Message);

            var exLang = Assert.Throws <InvalidOperationException>(() => EF.Functions.Contains("teststring", "teststring", 1033));

            Assert.Equal(
                MySqlStrings.FunctionOnClient(nameof(MySqlDbFunctionsExtensions.Contains)),
                exLang.Message);
        }
Beispiel #5
0
 /// <summary>
 ///     <para>
 ///         An implementation of the SQL MATCH operation for Full Text search.
 ///     </para>
 ///     <para>
 ///         The semantics of the comparison will depend on the database configuration.
 ///         In particular, it may be either case-sensitive or
 ///         case-insensitive.
 ///     </para>
 ///     <para>
 ///         Should be directly translated to SQL.
 ///         This function can't be evaluated on the client.
 ///     </para>
 /// </summary>
 /// <param name="_">The DbFunctions instance.</param>
 /// <param name="matchExpression">The property of entity that is to be matched.</param>
 /// <param name="pattern">The pattern against which Full Text search is performed</param>
 /// <param name="searchMode">Mode in which search is performed</param>
 /// <returns>true if there is a match.</returns>
 /// <exception cref="InvalidOperationException">Throws when query switched to client-evaluation.</exception>
 public static bool Match <T>(
     [CanBeNull] this DbFunctions _,
     [CanBeNull] T matchExpression,
     [CanBeNull] string pattern,
     MySqlMatchSearchMode searchMode)
 => throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(Match)));
 /// <summary>
 /// Checks if all of the given <paramref name="keys"/> exist as top-level keys within <paramref name="json"/>.
 /// </summary>
 /// <param name="_">DbFunctions instance</param>
 /// <param name="json">
 /// A JSON column or value. Can be a <see cref="JsonDocument"/>, a string, or a user POCO mapped to JSON.
 /// </param>
 /// <param name="keys">A set of keys to be checked inside <paramref name="json"/>.</param>
 /// <remarks>
 /// This operation is only supported with MySQL <c>json</c>, not <c>json</c>.
 ///
 /// See https://www.TODO.org/docs/current/functions-json.html.
 /// </remarks>
 public static bool JsonContainsPathAll([CanBeNull] this DbFunctions _, [NotNull] object json, [NotNull] params string[] paths)
 => throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(JsonContainsPathAll)));
 /// <summary>
 /// Checks if <paramref name="json"/> contains <paramref name="contained"/> as top-level entries.
 /// </summary>
 /// <param name="_">DbFunctions instance</param>
 /// <param name="json">
 /// A JSON column or value. Can be a <see cref="JsonDocument"/>, a string property mapped to JSON,
 /// or a user POCO mapped to JSON.
 /// </param>
 /// <param name="contained">
 /// A JSON column or value. Can be a <see cref="JsonDocument"/>, a string, or a user POCO mapped to JSON.
 /// </param>
 /// <remarks>
 /// This operation is only supported with MySQL <c>json</c>, not <c>json</c>.
 ///
 /// See https://www.TODO.org/docs/current/functions-json.html.
 /// </remarks>
 public static bool JsonContains(
     [CanBeNull] this DbFunctions _, [NotNull] object json, [NotNull] object candidate, [CanBeNull] string path)
 => throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(JsonContains)));
 public static bool JsonSearchAll([CanBeNull] this DbFunctions _, [NotNull] object json, [NotNull] string searchString, string path, string escapeChar)
 => throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(JsonSearchAll)));
 /// <summary>
 /// Returns the type of the outermost JSON value as a text string.
 /// Possible types are object, array, string, number, boolean, and null.
 /// </summary>
 /// <param name="_">DbFunctions instance</param>
 /// <param name="json">
 /// A JSON column or value. Can be a <see cref="JsonDocument"/>, a string, or a user POCO mapped to JSON.
 /// </param>
 /// <remarks>
 /// See https://www.TODO.org/docs/current/functions-json.html.
 /// </remarks>
 public static string JsonType([CanBeNull] this DbFunctions _, [NotNull] object json)
 => throw new InvalidOperationException(MySqlStrings.FunctionOnClient(nameof(JsonType)));