Dependency Injection and Service Integration
摘要
Throughout this book, we have been building MCP servers that do useful things, from returning space facts to looking up weather data. But if you have spent any time building real-world .NET applications, you know that the interesting parts rarely live inside a single static method. Real applications talk to databases, call external APIs, read configuration files, and write log entries. The glue that holds all of that together in modern .NET is dependency injection, or DI for short.