Skip to content

Instantly share code, notes, and snippets.

View rickenberg's full-sized avatar

Bernd Rickenberg rickenberg

View GitHub Profile
@rickenberg
rickenberg / NetworkDrive.cs
Created September 17, 2019 08:54
Mapping a network drive to a Windows 10 machine
using System;
using System.Runtime.InteropServices;
namespace Utility
{
public class NetworkDrive
{
private enum ResourceScope
{
RESOURCE_CONNECTED = 1,
@rickenberg
rickenberg / DbContextExtensions.cs EF6 extension to perform an UPSERT. This is a fork from another GIST. I have added a few useful comment and exposed the SQL as a private field for 'unit testing'.
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Core.Mapping;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.Infrastructure;
using System.Data.SqlTypes;
using System.Linq;
using System.Linq.Expressions;
using System.Text;