I have 6 API methods as you can see:
app.MapGet("/api/customer-money/", ([FromServices] IMediator mediator, string customerIsin)
=> mediator.Send(new GetMoneyQuery(customerIsin)));
app.MapGet("/api/customer-portfolio/", ([FromServices] IMediator mediator, string customerIsin)
=> mediator.Send(new GetPortfolioQuery(customerIsin)));
app.MapGet("/api/customer-order/", ([FromServices] IMediator mediator, string customerIsin)
=> mediator.Send(new GetOrdersQuery(customerIsin)));
app.MapPost("/api/add-order/", ([FromServices] IMediator mediator, AddOrderCommand cmd)
=> mediator.Send(cmd));
app.MapDelete("/api/delete-order/", ([FromServices] IMediator mediator, [FromBody] DeleteOrderCommand cmd)
=> mediator.Send(cmd));
app.MapPut("/api/modify-order/", ([FromServices] IMediator mediator,[FromBody] ModifyOrderCommand cmd)
=> mediator.Send(cmd));
app.Run();
Two teams want to use these API's; the first team needs to use 3 of them and the second team needs others, and the teams shouldn't access others team's API's.
I was thinking about creating an env in appsettings.json.
Would you please let me know if there is a better solution?
EnableOrderCRUD?