Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
namespace TilePuzzle
{
enum TileColors { Red, Blue, Yellow, Green }
class Program
{
@mjrousos
mjrousos / sample1.xml
Created June 5, 2019 21:47
WPF Migration
<ItemGroup>
<PackageReference Include="Castle.Windsor">
<Version>4.1.1</Version>
</PackageReference>
<PackageReference Include="MahApps.Metro">
<Version>1.6.5</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<Version>2.9.2</Version>
</PackageReference>
@mjrousos
mjrousos / DraftAuthPost.md
Last active October 24, 2016 14:19
Draft auth post

Bearer Token Authentication in ASP.NET Core

Introduction

ASP.NET Core Identity automatically supports cookie authentication. It is also straightforward to support authentication by external providers using the Google, Facebook, or Twitter ASP.NET Core authentication packages. One authentication scenario that requires a little bit more work, though, is to authenticate via bearer tokens. I recently worked with a customer who was interested in using JWT bearer tokens for authentication in mobile apps that worked with an ASP.NET Core back-end. Because some of their customers do

@mjrousos
mjrousos / 1-Seeding.cs
Created September 29, 2016 19:39
EF6 -> EF.Core
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
{
var context = serviceScope.ServiceProvider.GetService<MyContext>();
if (context.Database.EnsureCreated())
{
context.SeedData();
}
}
@mjrousos
mjrousos / BasicMiddleware.cs
Last active April 13, 2021 21:47
CustomMiddleware
// The middleware delegate to call after this one finishes processing
private readonly RequestDelegate _next;
public SOAPEndpointMiddleware(RequestDelegate next)
{
_next = next;
}