Exemplo n.º 1
0
        public void IsDate_should_throw_on_client_eval()
        {
            var exIsDate = Assert.Throws <InvalidOperationException>(() => EF.Functions.IsDate("#ISDATE#"));

            Assert.Equal(
                JetStrings.FunctionOnClient(nameof(JetDbFunctionsExtensions.IsDate)),
                exIsDate.Message);
        }
 /// <summary>
 ///     Validate if the given string is a valid date.
 ///     Corresponds to the SQL Server's ISDATE('date').
 /// </summary>
 /// <param name="_">The DbFunctions instance.</param>
 /// <param name="expression">Expression to validate</param>
 /// <returns>true for valid date and false otherwise.</returns>
 public static bool IsDate(
     [CanBeNull] this DbFunctions _,
     [NotNull] string expression)
 => throw new InvalidOperationException(JetStrings.FunctionOnClient(nameof(IsDate)));