Skip to content

SqlException: Incorrect syntax near the keyword 'WITH' #556

Open
@yasirkhanmkd

Description

@yasirkhanmkd

When ever I try to create a Page then the below exception occurs.
Stack is as given

SqlException: Incorrect syntax near the keyword 'WITH'. Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

Microsoft.Data.SqlClient.SqlCommand+<>c.b__211_0(Task result)
System.Threading.Tasks.ContinuationResultTaskFromResultTask<TAntecedentResult, TResult>.InnerInvoke()
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref Task currentTaskSlot, Thread threadPoolThread)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable+AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync<TState, TResult>(TState state, Func<DbContext, TState, CancellationToken, Task> operation, Func<DbContext, TState, CancellationToken, Task<ExecutionResult>> verifySucceeded, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable+AsyncEnumerator.MoveNextAsync()
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable+ConfiguredValueTaskAwaiter.GetResult()
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync(IQueryable source, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync(IQueryable source, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToArrayAsync(IQueryable source, CancellationToken cancellationToken)
Cofoundry.Domain.Internal.GetPageRoutingInfoByCustomEntityIdRangeQueryHandler.GetIdSetsAsync(GetPageRoutingInfoByCustomEntityIdRangeQuery query) in GetPageRoutingInfoByCustomEntityIdRangeQueryHandler.cs
+
var dbResult = await _dbContext
Cofoundry.Domain.Internal.GetPageRoutingInfoByCustomEntityIdRangeQueryHandler.ExecuteAsync(GetPageRoutingInfoByCustomEntityIdRangeQuery query, IExecutionContext executionContext) in GetPageRoutingInfoByCustomEntityIdRangeQueryHandler.cs
+
var idSets = await GetIdSetsAsync(query);
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteQueryAsync<TQuery, TResult>(TQuery query, IExecutionContext executionContext) in QueryExecutor.cs
+
var result = await handler.ExecuteAsync(query, cx);
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteAsync(IQuery query, IExecutionContext executionContext) in QueryExecutor.cs
+
result = await task;
Cofoundry.Domain.Internal.CustomEntitySummaryMapper.MapAsync(IReadOnlyCollection dbStatusQueries, IExecutionContext executionContext) in CustomEntitySummaryMapper.cs
+
var routings = await _queryExecutor.ExecuteAsync(routingsQuery, executionContext);
Cofoundry.Domain.Internal.SearchCustomEntitySummariesQueryHandler.ExecuteAsync(SearchCustomEntitySummariesQuery query, IExecutionContext executionContext) in SearchCustomEntitySummariesQueryHandler.cs
+
var mappedResult = await _customEntitySummaryMapper.MapAsync(dbPagedResult.Items, executionContext);
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteQueryAsync<TQuery, TResult>(TQuery query, IExecutionContext executionContext) in QueryExecutor.cs
+
var result = await handler.ExecuteAsync(query, cx);
Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteAsync(IQuery query, IExecutionContext executionContext) in QueryExecutor.cs
+
result = await task;
Cofoundry.Web.Internal.ApiResponseHelper.RunWithResultAsync(Func<Task> functionToExecute) in ApiResponseHelper.cs
+
var result = await functionToExecute();
Cofoundry.Web.Admin.CustomEntityDefinitionsApiController.GetCustomEntities(string customEntityDefinitionCode, SearchCustomEntitySummariesQuery query) in CustomEntityDefinitionsApiController.cs
+
return await _apiResponseHelper.RunQueryAsync(query);
lambda_method1313(Closure , object )
Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+TaskOfActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask.get_Result()
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
Cofoundry.Web.AutoUpdateMiddleware.Invoke(HttpContext cx) in AutoUpdateMiddleware.cs
+
await _next.Invoke(cx);
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions