C
C#•12mo ago
Timo Martinson

how to split code to multiple files in minimal api?

How to do that?
4 Replies
jcotton42
jcotton42•12mo ago
Just move it to other files? It's just some method calls and lambdas
Timo Martinson
Timo MartinsonOP•12mo ago
let's see 😉
Mayor McCheese
Mayor McCheese•12mo ago
Do you mean you want each minimal api to be it's own file?
PixxelKick
PixxelKick•12mo ago
If you want to split up the logic of your minimal api endpoints, you can use DI registered services as params in your endpoint registrations.
(int paramA, string paramB, IYourService svc) => svc.DoThing(paramA, paramB)
(int paramA, string paramB, IYourService svc) => svc.DoThing(paramA, paramB)
Want results from more Discord servers?
Add your server