Reputation: 195
After migrating a project from .NET Core 2.2 to version 3.1 I got an error with IAsyncEnumerator & IAsyncQueryProvider:
I managed to resolve the first issue related to IAsyncEnumerable with this fix below which I found on google:
<Target Name="ChangeAliasesOfReactiveExtensions" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'System.Interactive.Async'">
<Aliases>ix</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
However, I cannot find any solutions for the second issue.
Code example where I am getting an error:
internal class TestAsyncQueryProvider<TEntity> : IAsyncQueryProvider
{
private readonly IQueryProvider _inner;
internal TestAsyncQueryProvider(IQueryProvider inner)
{
_inner = inner;
}
public IQueryable CreateQuery(Expression expression)
{
return new TestAsyncEnumerable<TEntity>(expression);
}
public IQueryable<TElement> CreateQuery<TElement>(Expression expression)
{
return new TestAsyncEnumerable<TElement>(expression);
}
public object Execute(Expression expression)
{
return _inner.Execute(expression);
}
public TResult Execute<TResult>(Expression expression)
{
return _inner.Execute<TResult>(expression);
}
public IAsyncEnumerable<TResult> ExecuteAsync<TResult>(Expression expression)
{
return new TestAsyncEnumerable<TResult>(expression);
}
public Task<TResult> ExecuteAsync<TResult>(Expression expression, CancellationToken cancellationToken)
{
return Task.FromResult(Execute<TResult>(expression));
}
}
I wonder if anyone had similar issues and managed to resolve them. Also, worth mentioning, that I am still using EF Core v2.x and haven't migrated it to version 3 yet.
Upvotes: 2
Views: 1360
Reputation: 98
The interface for Execute was replaced with ExecuteAsync in the IdentityServer update.
There is a library that has successfully upgraded this mock implementation to .NET Core 3.0:
Upvotes: 1