Error in .net core with postgreSQL and graphQL to get json column for all records

Error in .net core with postgreSQL and graphQL to get json column for all records


0

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](IQueryable1 source) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken)
at HotChocolate.Data.ToListMiddleware1.InvokeAsync(IMiddlewareContext context) at HotChocolate.Resolvers.Expressions.Parameters.ServiceHelper.<>c__DisplayClass7_31.<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.

Error in .net core with postgreSQL and graphQL to get json column for all records

This is the C# code that I am using to get the list of records from the table:

Error in .net core with postgreSQL and graphQL to get json column for all records

And here is the screenshot of my model class:

Error in .net core with postgreSQL and graphQL to get json column for all records

Help me to fix this issue.

Appreciate your support


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *