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

            return(TransientDapperExtentions.QueryFirstOrDefaultWithRetry(() => Connection.QueryFirstOrDefault <int>(queryResult.GetSql(), queryResult.Param, transaction)));
        }
コード例 #2
0
        /// <inheritdoc />
        public virtual TEntity Find(Expression <Func <TEntity, bool> > predicate, IDbTransaction transaction)
        {
            var queryResult = SqlGenerator.GetSelectFirst(predicate, true);

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