Skip to content

Instantly share code, notes, and snippets.

View CBaud's full-sized avatar

Chris Baudin CBaud

View GitHub Profile
@CBaud
CBaud / CustomMemoryCache.cs
Created February 10, 2019 06:38
Demonstrate an IMemoryCache implementation that preserves evicted items.
namespace Service
{
using System.Collections.Concurrent;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
public class CustomMemoryCache : IMemoryCache
{
private readonly ConcurrentDictionary<object, object> _latest;
private readonly MemoryCache _cache;
@CBaud
CBaud / KestrelServerOptionsSetup.cs
Last active January 28, 2019 06:38
Demonstrate Kestrel support for an asynchronous server certificate selector.
namespace Service
{
using System;
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Azure.KeyVault;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
public class KestrelServerOptionsSetup : IConfigureOptions<KestrelServerOptions>