Skip to content

Instantly share code, notes, and snippets.

View klmallory's full-sized avatar

Kristen Mallory klmallory

View GitHub Profile
@klmallory
klmallory / TestRedisCluster
Created August 23, 2019 16:43
Redis Console Snippet
void TestRedisClusterGets()
{
var cacheCon = ConnectionMultiplexer.Connect("10.100.1.80:6379,10.100.1.81:6379,10.100.1.82:6379");
var sw = new Stopwatch();
Console.WriteLine($"Getting all keys {sw.ElapsedMilliseconds}ms");
var keys = cacheCon.GetDatabase().HashGetAll("KeyLookup").Select(s => $"KeyFormat_{s.Value}"));
@klmallory
klmallory / app.config.template
Last active November 22, 2017 16:24
Powershell Configure Script
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
@klmallory
klmallory / EntityRepository.cs
Created June 14, 2017 16:55
Simple Entity Framework Repository Pattern With Nesting Units of Work
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Patterns.Repository;
namespace System.Data.Entity.Repository
{