C
C#•13mo ago
Timo Martinson

how to split code to multiple files in minimal api?

How to do that?
4 Replies
jcotton42
jcotton42•13mo ago
Just move it to other files? It's just some method calls and lambdas
Timo Martinson
Timo MartinsonOP•13mo ago
let's see 😉
Mayor McCheese
Mayor McCheese•13mo ago
Do you mean you want each minimal api to be it's own file?
PixxelKick
PixxelKick•13mo 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