Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
@csalat
csalat / Startup.cs
Created April 10, 2020 12:29
Sqlite InMemory
private static void ConfigInMemoryDb(IServiceCollection services)
{
var connection = new SqliteConnection("DataSource=:memory:");
connection.Open();
services.AddSingleton(sp => connection);
var options = new DbContextOptionsBuilder<MyContext>()
.UseSqlite(connection)
.Options;
using (var context = new MyContext(options))
{
@csalat
csalat / Actors.md
Created December 29, 2021 13:59 — forked from peltho/Actors.md
Transcript of "Way to do things" from Peter Bourgon

Ways to do things (from Peter Bourgon)

Actors

// Actor model (state machine)
type stateMachine struct {
    state string
    actionc chan func()
}