C
C#•7mo ago
Timo Martinson

how to split code to multiple files in minimal api?

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