From 25897342bda2c7c1e99d4564980b0f52b424e7ac Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 8 Jun 2020 18:32:53 +0200 Subject: [PATCH] Fixes --- src/EFCore/Properties/CoreStrings.Designer.cs | 2 +- src/EFCore/Properties/CoreStrings.resx | 2 +- src/Shared/SharedTypeExtensions.cs | 2 +- .../Query/NorthwindMiscellaneousQueryInMemoryTest.cs | 4 ++++ .../Query/UdfDbFunctionTestBase.cs | 2 +- .../CustomConvertersTestBase.cs | 8 ++++---- test/EFCore.Specification.Tests/Query/QueryTestBase.cs | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/EFCore/Properties/CoreStrings.Designer.cs b/src/EFCore/Properties/CoreStrings.Designer.cs index 1e40d779673..626522b56ee 100644 --- a/src/EFCore/Properties/CoreStrings.Designer.cs +++ b/src/EFCore/Properties/CoreStrings.Designer.cs @@ -2607,7 +2607,7 @@ public static string QueryUnableToTranslateStringEqualsWithStringComparison => GetString("QueryUnableToTranslateStringEqualsWithStringComparison"); /// - /// Translation of method '{declaringTypeName}.{methodName}' failed. If you are trying to map your custom function, see https://go.microsoft.com/fwlink/?linkid=****** for more information. + /// Translation of method '{declaringTypeName}.{methodName}' failed. If you are trying to map your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. /// public static string QueryUnableToTranslateMethod([CanBeNull] object methodName, [CanBeNull] object declaringTypeName) => string.Format( diff --git a/src/EFCore/Properties/CoreStrings.resx b/src/EFCore/Properties/CoreStrings.resx index 89cf2f65ca2..dbd4793f726 100644 --- a/src/EFCore/Properties/CoreStrings.resx +++ b/src/EFCore/Properties/CoreStrings.resx @@ -1375,7 +1375,7 @@ Translation of 'string.Equals' method which takes 'StringComparison' argument is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information. - Translation of method '{declaringTypeName}.{methodName}' failed. If you are trying to map your custom function, see https://go.microsoft.com/fwlink/?linkid=****** for more information. + Translation of method '{declaringTypeName}.{methodName}' failed. If you are trying to map your custom function, see https://go.microsoft.com/fwlink/?linkid=2132413 for more information. Invalid {state} encountered. diff --git a/src/Shared/SharedTypeExtensions.cs b/src/Shared/SharedTypeExtensions.cs index 7f44f3cfefd..a01d0a8ae73 100644 --- a/src/Shared/SharedTypeExtensions.cs +++ b/src/Shared/SharedTypeExtensions.cs @@ -380,7 +380,7 @@ public static string DisplayName([NotNull] this Type type, bool fullName = true) return stringBuilder.ToString(); } - private static void ProcessType(StringBuilder builder, Type type, bool fullName) + private static void ProcessType(StringBuilder builder, Type type, bool fullName) { if (type.IsGenericType) { diff --git a/test/EFCore.InMemory.FunctionalTests/Query/NorthwindMiscellaneousQueryInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Query/NorthwindMiscellaneousQueryInMemoryTest.cs index fb05af7aae8..ced0ba9b9a1 100644 --- a/test/EFCore.InMemory.FunctionalTests/Query/NorthwindMiscellaneousQueryInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Query/NorthwindMiscellaneousQueryInMemoryTest.cs @@ -50,6 +50,10 @@ public override Task Where_query_composition_entity_equality_multiple_elements_S public override void Client_code_using_instance_in_anonymous_type() => base.Client_code_using_instance_in_anonymous_type(); + [ConditionalTheory(Skip = "Issue#17050")] + public override Task Client_code_unknown_method(bool async) + => base.Client_code_unknown_method(async); + [ConditionalFact(Skip = "Issue#17050")] public override void Client_code_using_instance_in_static_method() => base.Client_code_using_instance_in_static_method(); diff --git a/test/EFCore.Relational.Specification.Tests/Query/UdfDbFunctionTestBase.cs b/test/EFCore.Relational.Specification.Tests/Query/UdfDbFunctionTestBase.cs index 8620dbed723..845b85f3d45 100644 --- a/test/EFCore.Relational.Specification.Tests/Query/UdfDbFunctionTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Query/UdfDbFunctionTestBase.cs @@ -1927,7 +1927,7 @@ orderby c.Id private void AssertTranslationFailed(Action testCode) => Assert.Contains( - CoreStrings.TranslationFailed("").Substring(21), + CoreStrings.TranslationFailed("").Substring(48), Assert.Throws(testCode).Message); } } diff --git a/test/EFCore.Specification.Tests/CustomConvertersTestBase.cs b/test/EFCore.Specification.Tests/CustomConvertersTestBase.cs index b9fa3db8fb6..69b752d132e 100644 --- a/test/EFCore.Specification.Tests/CustomConvertersTestBase.cs +++ b/test/EFCore.Specification.Tests/CustomConvertersTestBase.cs @@ -570,8 +570,8 @@ protected class ValueWrapper public virtual void Collection_property_as_scalar_Any() { using var context = CreateContext(); - Assert.Equal( - @"The LINQ expression 'DbSet() .Where(c => c.Tags .Any())' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", + Assert.Contains( + @"Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", Assert.Throws( () => context.Set().Where(e => e.Tags.Any()).ToList()) .Message.Replace("\r", "").Replace("\n", "")); @@ -600,8 +600,8 @@ public virtual void Collection_enum_as_string_Contains() { using var context = CreateContext(); var sameRole = Roles.Seller; - Assert.Equal( - @"The LINQ expression 'DbSet() .Where(c => c.Roles.Contains(__sameRole_0))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", + Assert.Contains( + @"Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.", Assert.Throws( () => context.Set().Where(e => e.Roles.Contains(sameRole)).ToList()) .Message.Replace("\r", "").Replace("\n", "")); diff --git a/test/EFCore.Specification.Tests/Query/QueryTestBase.cs b/test/EFCore.Specification.Tests/Query/QueryTestBase.cs index ef9c6e9034b..f3c7991df89 100644 --- a/test/EFCore.Specification.Tests/Query/QueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/QueryTestBase.cs @@ -1110,7 +1110,7 @@ protected void AssertGrouping( protected static async Task AssertTranslationFailed(Func query) => Assert.Contains( - CoreStrings.TranslationFailed("").Substring(21), + CoreStrings.TranslationFailed("").Substring(48), (await Assert.ThrowsAsync(query)) .Message);