Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request DapperLib#68 from tms/rainbow-extensibility
Updated Table methods to better support multi-DB
  • Loading branch information
SamSaffron committed Dec 6, 2012
2 parents fb04a9c + 73d0ba3 commit b3dc7d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dapper.Rainbow/Database.cs
Expand Up @@ -90,7 +90,7 @@ public int Update(TId id, dynamic data)
/// <returns></returns>
public bool Delete(TId id)
{
return database.Execute("delete " + TableName + " where Id = @id", new { id }) > 0;
return database.Execute("delete from " + TableName + " where Id = @id", new { id }) > 0;
}

/// <summary>
Expand All @@ -103,7 +103,7 @@ public T Get(TId id)
return database.Query<T>("select * from " + TableName + " where Id = @id", new { id }).FirstOrDefault();
}

public T First()
public virtual T First()
{
return database.Query<T>("select top 1 * from " + TableName).FirstOrDefault();
}
Expand Down

0 comments on commit b3dc7d1

Please sign in to comment.