From 413f83f8d81f14cf054a777102918ebf701d8055 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Fri, 20 Dec 2024 17:00:02 +0700 Subject: [PATCH] markup route parameters as services --- backend/FwLite/LocalWebApp/Routes/FwIntegrationRoutes.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/FwLite/LocalWebApp/Routes/FwIntegrationRoutes.cs b/backend/FwLite/LocalWebApp/Routes/FwIntegrationRoutes.cs index 017797744..d99fa6462 100644 --- a/backend/FwLite/LocalWebApp/Routes/FwIntegrationRoutes.cs +++ b/backend/FwLite/LocalWebApp/Routes/FwIntegrationRoutes.cs @@ -1,5 +1,6 @@ using FwDataMiniLcmBridge; using LocalWebApp.Hubs; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using Microsoft.OpenApi.Models; @@ -19,7 +20,10 @@ public static IEndpointConventionBuilder MapFwIntegrationRoutes(this WebApplicat return operation; }); group.MapGet("/open/entry/{id}", - async (FwDataProjectContext context, IHubContext hubContext, FwDataFactory factory, Guid id) => + async ([FromServices] FwDataProjectContext context, + [FromServices] IHubContext hubContext, + [FromServices] FwDataFactory factory, + Guid id) => { if (context.Project is null) return Results.BadRequest("No project is set in the context"); await hubContext.Clients.Group(context.Project.Name).OnProjectClosed(CloseReason.Locked);