Microsoft.AspNetCore.Http.FormFile (link) is the default implementation of IFormFile which represents a file sent with the HttpRequest. This class contains a Stream, as such it should implement IDisposable.
How come it does not? Is there a design reason behind this?
>Solution :
Because FormFile is not the owner of the stream, it accepts stream (request one) as constructor parameter which is passed to it by the ASP.NET Core machinery (for example here). Request stream for example can be buffered and read multiple times or it can contain multiple files, etc. so the FormFile should not dispose it, hence it does not implement IDisposable.