Skip to content

Instantly share code, notes, and snippets.

@dasch88
dasch88 / EFExtensions.cs
Last active September 4, 2018 01:02 — forked from ondravondra/EFExtensions.cs
C# extension for executing upsert (MERGE SQL command) in EF with MSSQL. Automatically retrieves keys from entity, and combines script into single statement for IEnumerable.
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@mcliment
mcliment / Benchmark.cs
Last active December 17, 2023 11:18
Test to check the speed of List.ForEach vs List.AddRange
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
namespace ForEachVsAddRange
{
[MemoryDiagnoser]
public class Benchmark
{