Skip to content

Instantly share code, notes, and snippets.

View EndpointInit.cs
public class EndpointInit
{
private readonly IServiceProvider provider;
private readonly IActionDescriptorCollectionProvider collectionProvider;
private readonly IActionInvokerFactory invokerFactory;
private readonly PageLoader pageLoader;
public EndpointInit(IServiceProvider provider, IActionDescriptorCollectionProvider collectionProvider, IActionInvokerFactory invokerFactory, PageLoader pageLoader)
{
this.provider = provider;
@lakeman
lakeman / AutoMigration.cs
Last active Jan 19, 2022
Automatic database migration with EF Core 3.0
View AutoMigration.cs
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design.Internal;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations.Design;
using Microsoft.EntityFrameworkCore.Migrations.Operations;
using Microsoft.EntityFrameworkCore.Storage;
@lakeman
lakeman / Impersonate.cs
Created Nov 24, 2017
Win32 Impersonate Middleware
View Impersonate.cs
public class Impersonate
{
private readonly RequestDelegate next;
private ILogger<Impersonate> logger;
private readonly IServiceProvider _provider;
public Impersonate(ILogger<Impersonate> logger, RequestDelegate next, IServiceProvider provider) {
this.next = next;
this.logger = logger;