Tag: entity-framework
-
The LINQ expression OrderBy DateTimeOffset.DateTime could not be translated
0 I have a .NET Core project in which I have implemented this GraphQL query. The query works correctly, but the sorting by date is not working. [UsePaging(MaxPageSize = 200, IncludeTotalCount = true)] [UseProjection] [UseFiltering] [UseSorting] public async Task<IQueryable<UserDto>> UserMetadatas(string myValue, [Service] ActivityEngineDataContext context,[Service] IMapper mapper) { var entities = context.Users.Where(act => act.MyValue== myValue); return…
-
An error occurred while executing the command definition. See the inner exception for details.(11)
-1 I added one table inside db and generated model with entity framework in asp.net web api(not core) when i try to access that particular end point I am getting this error fast if someone knows this how to solve post your answer I tried this today and expecting an answer asp.net entity-framework graphql Share…
-
How to avoid manual inlining inside LINQ query to use as an expression and convert to SQL
0 I am trying to do some projections in LINQ to convert to DTOs. The goal is to do it with expressions so that it is translated directly to SQL. It works perfectly if I do everything inlined like this : return workHeader.Select(x => new WorkHeaderDto { Id = x.Id, StartDate = x.Works.Min(w => w.StartDate),…
-
How to use stored procedure in GraphQL using HotChocolate
0 I am currently working on a legacy application which is built on the .NET framework and uses a MySQL database. We are migrating the application to GraphQL and .NET Core. We need to use the existing stored procedures. Because, the useridDB-role is passed to the stored procedure to filter the data at the database…
-
Cannot access to a disposed context instance
0 I’m using dotnet 6 with GraphQL 7. I’m having some issues only in one Field. The error appears only when the app is deployed in the cluster (kubernetes), but never in local. So it seems like the Dependency Injection is not working properly, here is the code of the query: public class UserModulesProgressField :…