Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jun 9, 2020
1 parent 38d2bc4 commit 2589734
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/EFCore/Properties/CoreStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/EFCore/Properties/CoreStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@
<value>Translation of 'string.Equals' method which takes 'StringComparison' argument is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information.</value>
</data>
<data name="QueryUnableToTranslateMethod" xml:space="preserve">
<value>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.</value>
<value>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.</value>
</data>
<data name="InvalidStateEncountered" xml:space="preserve">
<value>Invalid {state} encountered.</value>
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/SharedTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ orderby c.Id

private void AssertTranslationFailed(Action testCode)
=> Assert.Contains(
CoreStrings.TranslationFailed("").Substring(21),
CoreStrings.TranslationFailed("").Substring(48),
Assert.Throws<InvalidOperationException>(testCode).Message);
}
}
8 changes: 4 additions & 4 deletions test/EFCore.Specification.Tests/CustomConvertersTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CollectionScalar>() .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<InvalidOperationException>(
() => context.Set<CollectionScalar>().Where(e => e.Tags.Any()).ToList())
.Message.Replace("\r", "").Replace("\n", ""));
Expand Down Expand Up @@ -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<CollectionEnum>() .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<InvalidOperationException>(
() => context.Set<CollectionEnum>().Where(e => e.Roles.Contains(sameRole)).ToList())
.Message.Replace("\r", "").Replace("\n", ""));
Expand Down
2 changes: 1 addition & 1 deletion test/EFCore.Specification.Tests/Query/QueryTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ protected void AssertGrouping<TKey, TElement>(

protected static async Task AssertTranslationFailed(Func<Task> query)
=> Assert.Contains(
CoreStrings.TranslationFailed("").Substring(21),
CoreStrings.TranslationFailed("").Substring(48),
(await Assert.ThrowsAsync<InvalidOperationException>(query))
.Message);

Expand Down

0 comments on commit 2589734

Please sign in to comment.