/// <inheritdoc />
        public virtual Task <int> CountAsync(Expression <Func <TEntity, bool> > predicate, Expression <Func <TEntity, object> > distinctField, IDbTransaction transaction)
        {
            var queryResult = SqlGenerator.GetCount(predicate, distinctField);

            return(TransientDapperExtentions.QueryFirstOrDefaultWithRetryAsync(() => Connection.QueryFirstOrDefaultAsync <int>(queryResult.GetSql(), queryResult.Param, transaction)));
        }
Beispiel #2
0
        /// <inheritdoc />
        public virtual Task <TEntity> FindAsync(Expression <Func <TEntity, bool> > predicate, IDbTransaction transaction)
        {
            var queryResult = SqlGenerator.GetSelectFirst(predicate, true);

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