'ReadAsMultipartAsync is not available in net 6

I would like to know how I can replace this method. I use NET.6 and Content and method ReadAsMultipartAsync are not available.

Example code:

private async Task<bool> readPart(MultipartFormDataStreamProvider provider)
{
    try
    {
       InMemoryMultipartFormDataStreamProvider provider = null;
        provider = await  Request.Content.ReadAsMultipartAsync(new 
        InMemoryMultipartFormDataStreamProvider());

        ResumableConfiguration configuration = GetUploadConfiguration(provider);
                int chunkNumber = GetChunkNumber(provider);

        // Rename generated file
        MultipartFileData chunk = provider.FileData[0]; // Only one file in multipart message
                RenameChunk(chunk, chunkNumber, configuration.Identifier);

        // Assemble chunks into single file if they're all here
        TryAssembleFile(configuration);
                return true;
    }
    catch 
    {
        return false;
    }
}

I mean this line

  provider = await  Request.Content.ReadAsMultipartAsync(new InMemoryMultipartFormDataStreamProvider());

Thanks

Regards



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source