/// <inheritdoc />
        public virtual Task <TEntity> FindByIdAsync(object id, IDbTransaction transaction)
        {
            var queryResult = SqlGenerator.GetSelectById(id, true);

            return(TransientDapperExtentions.QuerySingleOrDefaultWithRetryAsync(() => Connection.QuerySingleOrDefaultAsync <TEntity>(queryResult.GetSql(), queryResult.Param, transaction)));
        }
        /// <inheritdoc />
        public virtual Task <int> CountAsync(Expression <Func <TEntity, bool> > predicate, IDbTransaction transaction)
        {
            var queryResult = SqlGenerator.GetCount(predicate);

            return(TransientDapperExtentions.QuerySingleOrDefaultWithRetryAsync(() => Connection.QueryFirstOrDefaultAsync <int>(queryResult.GetSql(), queryResult.Param, transaction)));
        }