I am using .NET Core 7.0 with PostgreSQL and graphQL. I am getting an error when I try to get all records from the database using the below code. When I try to get a single record then it is working fine.
Error:
The source ‘IQueryable’ doesn’t implement ‘IAsyncEnumerable<Vcp.Doctors.Gql.Models.ProviderInformation>’. Only sources that implement ‘IAsyncEnumerable’ can be used for Entity Framework asynchronous operations.
Stacktrace
at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AsAsyncEnumerable[TSource](IQueryable
1 source) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable
1 source, CancellationToken cancellationToken)
at HotChocolate.Data.ToListMiddleware1.InvokeAsync(IMiddlewareContext context) at HotChocolate.Resolvers.Expressions.Parameters.ServiceHelper.<>c__DisplayClass7_3
1.<b__5>d.MoveNext()End of stack trace from previous location
at HotChocolate.Resolvers.Expressions.Parameters.ServiceHelper.<>c__DisplayClass7_1`1.<b__3>d.MoveNext()
End of stack trace from previous location
at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)
at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)
I have a JSON field for the KnownByOtherName
column of my PostgreSQL database.
This is the C# code that I am using to get the list of records from the table:
And here is the screenshot of my model class:
Help me to fix this issue.
Appreciate your support