diff --git a/MySqlPlus/MySqlPlus.csproj b/MySqlPlus/MySqlPlus.csproj index d37ab84..2e43ed4 100644 --- a/MySqlPlus/MySqlPlus.csproj +++ b/MySqlPlus/MySqlPlus.csproj @@ -7,7 +7,7 @@ MontoyaTech.MySqlPlus MontoyaTech.MySqlPlus MontoyaTech.MySqlPlus - 1.1.3 + 1.1.4 MontoyaTech A simple C# library to help work with MySql. MontoyaTech 2023 diff --git a/MySqlPlus/MySqlSession.cs b/MySqlPlus/MySqlSession.cs index 8df9e57..500422c 100644 --- a/MySqlPlus/MySqlSession.cs +++ b/MySqlPlus/MySqlSession.cs @@ -145,6 +145,42 @@ namespace MontoyaTech.MySqlPlus } } + /// + /// Returns whether or not a row of a given type exists by id in the db. + /// + /// + /// + /// + public bool Exists(ulong id) + { + using (var command = new MySqlCommand()) + { + command.Exists(id); + + using (var reader = this.Connection.ExecuteReader(command)) + return reader.GetBoolean(0); + + } + } + + /// + /// Returns whether or not a row of a given type exists by id in the db. + /// + /// + /// + /// + public bool Exists(string id) + { + using (var command = new MySqlCommand()) + { + command.Exists(id); + + using (var reader = this.Connection.ExecuteReader(command)) + return reader.GetBoolean(0); + + } + } + /// /// Deletes a row in the db. ///