Commit 5e8051e1 authored by Sam's avatar Sam

Merge pull request #29 from danzel/master

Throw an exception when asked to Delete<MyType>(null)
parents 4326beac fad9e605
...@@ -255,6 +255,9 @@ private static string GetTableName(Type type) ...@@ -255,6 +255,9 @@ private static string GetTableName(Type type)
/// <returns>true if deleted, false if not found</returns> /// <returns>true if deleted, false if not found</returns>
public static bool Delete<T>(this IDbConnection connection, T entityToDelete, IDbTransaction transaction = null, int? commandTimeout = null) where T : class public static bool Delete<T>(this IDbConnection connection, T entityToDelete, IDbTransaction transaction = null, int? commandTimeout = null) where T : class
{ {
if (entityToDelete == null)
throw new ArgumentException("Cannot Delete null Object", "entityToDelete");
var type = typeof(T); var type = typeof(T);
var keyProperties = KeyPropertiesCache(type); var keyProperties = KeyPropertiesCache(type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment