Skip to content

Instantly share code, notes, and snippets.

View copernicus365's full-sized avatar

Nicholas Petersen copernicus365

  • Huber Heights, Ohio
View GitHub Profile
@copernicus365
copernicus365 / TestEnumDict.cs
Created October 21, 2014 18:07
Test performance of a Dictionary with enum key, against Dictionary with int key
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace EnumTest
{
/// <summary>
/// Test to discover how well enum lookups are handled in a Dictionary.
@copernicus365
copernicus365 / DatabaseXtensions.cs
Last active December 25, 2015 20:48
Adds an extension method named ExecuteSqlCommandWithReturn that extends EntityFramework's Database type (System.Data.Entity.Database) allowing one to obtain the return value from a call to a stored procedure (called with the 'EXEC' keyword). NO CHANGES need be made in code (in your SQL scripts or in any big way in the calling code)! Just replace…
using System;
using System.Data;
using System.Data.Entity;
using System.Data.SqlClient;
namespace Eclipsoft.Db
{
/// <summary>
/// Adds an extension method named ExecuteSqlCommandWithReturn
/// that extends EntityFramework's Database type (System.Data.Entity.Database)