Closed nicholaslambertucci-ett closed 1 year ago
When clicking on "New Floor" button in Map section of the Frontend, server api returns 500 Status response.
server log
Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: System.InvalidOperationException: Sequence contains no elements. Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at euroma2.Controllers.MapController.GetMapPriv() in C:\ETT\Progetti\PTA\CMS Backend\euroma2\Controllers\MapController.cs:line 184 Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at euroma2.Controllers.MapController.Post(FloorInfo serv) in C:\ETT\Progetti\PTA\CMS Backend\euroma2\Controllers\MapController.cs:line 70 Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at lambda_method912(Closure , Object ) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Dec 27 13:02:06 vETTGESLSAS12 ptacms-backend: at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
You need first to create a MAP on the DB.
You cannot create a floor if there is no map.
Solved creating the "map" record.
When clicking on "New Floor" button in Map section of the Frontend, server api returns 500 Status response.
server log