Question
I have a project using .NET 9, specifically an Aspire setup, and I would like to have my C# API application to call another C# API specifically for AI-related features. I’m looking for a straightforward way to accomplish this while maintaining type safety when making calls from one API to another. Can I somehow pass actual instances of services between Aspire and my applications?
Are there built-in features or recommended approaches in .NET 9 for typed API communication between two C# APIs? Examples or guidance on the best practices for this would be greatly appreciated.
Thoughts
The alternative solution is that my AI project declares an extension that my API can wire up, but this sort of forfeits the whole isolation-thing I am going for.
As a RESTful API, any API can make a request to another, but I am looking for a way to be able to call from one to another as if the service is in the same project, despite each API running separately.