Commit fad9e605 authored by danzel's avatar danzel

Throw an exception when asked to Delete<MyType>(null) rather than trying to as...

Throw an exception when asked to Delete<MyType>(null) rather than trying to as in Npgsql it will delete the whole table.
parent 4326beac
......@@ -255,6 +255,9 @@ private static string GetTableName(Type type)
/// <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
{
if (entityToDelete == null)
throw new ArgumentException("Cannot Delete null Object", "entityToDelete");
var type = typeof(T);
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