简体   繁体   中英

how to load ResponseCompressionDefaults function (Blazor WebAssembly SignalR)

I am learning Blazor from below Microsoft's tutorial.

( https://docs.microsoft.com/ko-kr/aspnet/core/tutorials/signalr-blazor-webassembly?view=aspnetcore-5.0&tabs=visual-studio-mac#prerequisites )

When I write part, I want to use "ResponseCompressionDefaults" function, but there is red line below at my editor like screenshot.

how can I load "ResponseCompressionDefaults" function on my editor?

Please, help me.

enter image description here

public void ConfigureServices(IServiceCollection services)
{
    services.AddSignalR();
    services.AddControllersWithViews();
    services.AddRazorPages();
    services.AddResponseCompression(opts =>
    {
        opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
            new[] { "application/octet-stream" });
    });
}

you need a using statement for this to work:

using Microsoft.AspNetCore.ResponseCompression;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM