I'm wondering why I don't have to use required namespaces anymore in a .NET 7.0 application. I'm doing some tests in Blazor app and I noticed that I no longer have to include namespaces at the beginning of the file like I used to.
In that example file that I'm showing I'm using IEnumerable
interface and HttpClient
class. Why I don't have to use below at the beginning of the file ?
using System.Collections.Generic;
using System.Net.Http;
If I include those anyway, then the IDE shows them as unnecessary namespaces that I can get rid - why? Where does C# know which namespace these interfaces/class needs?
I'm not aware of any file that would globally use these namespaces. Is there anything like that ?
The project is Blazor Server App. I'm using .NET 7.0, Visual Studio 2022 Version 17.6.4