Skip to content

Instantly share code, notes, and snippets.

View seesharper's full-sized avatar
🏠
Working from home

Bernhard Richter seesharper

🏠
Working from home
View GitHub Profile
using System;
using System.Reflection;
using DbReader.LightInject;
namespace DbReader.Tests
{
public class ContainerFixture : IDisposable
{
public ContainerFixture()
{
@seesharper
seesharper / Program.cs
Last active October 14, 2019 20:50
InterceptionDemo
using System;
using LightInject.Interception;
namespace InterceptionDemo
{
class Program
{
static void Main(string[] args)
{
var proxyBuilder = new ProxyBuilder();
@seesharper
seesharper / ContainerExtensions.cs
Created September 18, 2019 13:37
QueryHandle and CommandHandler registration
/// <summary>
/// Extends the <see cref="IServiceRegistry"/> interface
/// </summary>
public static class ContainerExtensions
{
/// <summary>
/// Registers all implementations of the <see cref="ICommandHandler{TCommand}"/> interface.
/// </summary>
/// <param name="serviceRegistry">The target <see cref="IServiceRegistry"/>.</param>
@seesharper
seesharper / LightInject.TopShelf.cs
Created March 28, 2019 10:01
LightInject TopShelf
public static class LightInjectServiceConfiguratorExtensions
{
public static Func<T> GetFactory<T>() where T : class
{
return () => ServiceFactoryExtensions.GetInstance<T>(LightInjectBuilderConfigurator.ServiceContainer);
}
public static ServiceConfigurator<T> ConstructUsingLightInject<T>(this ServiceConfigurator<T> configurator) where T : class
{
Type[] interfaces = typeof(T).GetInterfaces();
@seesharper
seesharper / mono.props
Created January 23, 2019 12:35
Include this to enable building .Net Framework on *nix
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono>
<!-- Look in the standard install locations -->
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
<BaseFrameworkPathOverrideForMono Cond
@seesharper
seesharper / GlobalScripts.md
Last active June 3, 2018 21:21
Global script docs take 1

Installing scripts globally

Say now that we have written some sort of utility script that really rocks and we would like to make this script available on our system as a global command.

Let's call this script rock.csx

Console.WriteLine("Global scripts rocks!")
Console.WriteLine("Hello World");
@seesharper
seesharper / omnisharp-release.csx
Last active April 13, 2018 11:20
List the latest OmniSharp release
#! "netcoreapp2.0"
#r "nuget: WindowsAzure.Storage, 9.1.1"
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
await ListLatestOmniSharpRelease();
public static async Task ListLatestOmniSharpRelease()
#load "Calculator.csx"
#load "TestRunner.csx"
#r "nuget:FluentAssertions, 4.19.4"
using FluentAssertions;
RunTestsFrom<CalculatorTests>();
public class CalculatorTests : IDisposable
{
public CalculatorTests()

This document shows how to model veins in a relations model.

FACT: Veins can split into several other veins that in turn merges into other veins.

tbl_veins

This table simply list all the veins

Id Name