Skip to content

Instantly share code, notes, and snippets.

View ismaelgasparin's full-sized avatar

Ismael "Bill" Gasparin ismaelgasparin

View GitHub Profile
public class DatabaseDeleter
{
private readonly ISessionFactory _configuration;
private static readonly string[] _ignoredTables = new[] { "sysdiagrams", /* DB Migration tables too */ };
private static string[] _tablesToDelete;
private static string _deleteSql;
private static object _lockObj = new object();
private static bool _initialized;
public DatabaseDeleter(ISessionFactory sessionSource)
@johnnyreilly
johnnyreilly / DecimalModelBinder.cs
Last active July 27, 2017 09:37
Phil Haacks DecimalModelBinder adapted to handle nullable decimals
using System;
using System.Globalization;
using System.Web.Mvc;
namespace My.ModelBinders
{
/// <summary>
/// Thank you Phil Haack: used to model bind multiple culture decimals
/// http://haacked.com/archive/2011/03/19/fixing-binding-to-decimals.aspx
///