/// <summary> /// Execute SQL that checks if an entity exists. /// </summary> /// <typeparam name="T">Type of entity.</typeparam> /// <param name="primaryKey">A single primary key to check.</param> /// <returns> /// True if record is found. /// </returns> public bool Exists <T>(object primaryKey) where T : class => ExecuteInternal(() => SharedConnection.Exists <T>(primaryKey, _transaction, OneTimeCommandTimeout ?? CommandTimeout));
/// <summary> /// Execute SQL that checks if an entity exists. /// </summary> /// <typeparam name="T">Type of entity.</typeparam> /// <param name="sql">The SQL clause to check for existence.</param> /// <param name="parameters">The parameters to use for this query.</param> /// <returns> /// True if record is found. /// </returns> public bool Exists <T>(string sql, object parameters) where T : class => ExecuteInternal(() => SharedConnection.Exists <T>(sql, parameters, _transaction, OneTimeCommandTimeout ?? CommandTimeout));
/// <summary> /// Execute SQL that checks if an entity exists. /// </summary> /// <typeparam name="T">Type of entity.</typeparam> /// <param name="entityToCheck">Entity to check for existence.</param> /// <returns> /// True if record is found. /// </returns> public bool Exists <T>(T entityToCheck) where T : class => ExecuteInternal(() => SharedConnection.Exists(entityToCheck, _transaction, OneTimeCommandTimeout ?? CommandTimeout));