Skip to content

Instantly share code, notes, and snippets.

interface IRequestDecompressionProvider
{
bool TryDecompressRequest(HttpContext httpContext);
}
public sealed class GzipDecompressionProvider : IRequestDecompressionProvider
{
bool TryDecompressRequest(HttpContext context)
{
// e.g. Content-Encoding: br, deflate, gzip
@pranavkm
pranavkm / AOT.md
Last active April 22, 2021 18:45
AOT for Blazor
  • Install the latest preview SDK:

  • Install the blazor-aot tool and acquire the SDK

    • dotnet new nugetconfig
    • edit the nuget.config file to include nightly feed:
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777f5)[0x7f76c838c7f5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8038a)[0x7f76c839538a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f76c839958c]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(CRYPTO_free+0x1d)[0x7f76bf8520cd]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(+0x13a69f)[0x7f76bf92969f]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(+0x13ae70)[0x7f76bf929e70]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(+0x1416a0)[0x7f76bf9306a0]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(+0x142336)[0x7f76bf931336]
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0(+0x1425ad)[0x7f76bf9315ad]
public record Person([FromRoute][Required][StringLength(1, 8)] string id);
public record Person
{
public Person(string id) => Id = id;
[FromRoute][Required][StringLength(1, 8)]
public string Id { get; init; }
}
public record Person([FromRoute][Required][StringLength(1, 8)] string id);
public record Person
{
public Person(string id) => Id = id;
[FromRoute][Required][StringLength(1, 8)]
public string Id { get; init; }
}
## Current

637287883825561612: watch : Exited
637287883825568665: watch : File changed: D:\temp\c\Views\Home\Index.cshtml <--- a1
637287883831872268: watch : Started
637287883852917785: info: Microsoft.Hosting.Lifetime[0]
637287883852923489:       Now listening on: https://localhost:5001          <--- b1   (b1 - a1): TotalMilliseconds : 2735.4824
637287883852928268: info: Microsoft.Hosting.Lifetime[0]
637287883852932657:       Now listening on: http://localhost:5000
Name Length
http://localhost:5000/ 904
customJsFileForTests.js 188
_framework/blazor.webassembly.js 13295
_framework/blazor.boot.json 1424
_framework/wasm/dotnet.3.2.0.js?customizedbootresource=true 50911
_framework/_bin/HostedInAspNet.Client.dll 2874
_framework/_bin/Microsoft.AspNetCore.Components.dll 48735
_framework/_bin/Microsoft.AspNetCore.Components.Forms.dll 7899
Name Length
http://localhost:5000/ 904
customJsFileForTests.js 188
_framework/blazor.webassembly.js 13295
_framework/blazor.boot.json 1424
_framework/wasm/dotnet.3.2.0.js?customizedbootresource=true 50911
_framework/_bin/HostedInAspNet.Client.dll 2874
_framework/_bin/Microsoft.AspNetCore.Components.dll 48735
_framework/_bin/Microsoft.AspNetCore.Components.Forms.dll 7899
public class Person
{
static readonly string[] Clearances = new[] { "Alpha", "Beta", "Gamma", "Delta", "Epsilon" };
public string Name { get; set; }
public int Salary { get; set; }
public bool IsAdmin { get; set; }
public List<Person> Subordinates { get; set; }
public Dictionary<string, object> SecurityClearances { get; set; }