Esempio n. 1
0
        /// <summary>
        /// Execute an update query over db connection
        /// </summary>
        /// <param name="entity">entity with identify the fech element</param>
        /// <returns></returns>
        public async Task <T> GetByPK(T entity)
        {
            var    dynamicParameters = new DynamicParameters();
            string query             = _queryHelper.SelectQueryByKeys(entity, ref dynamicParameters);

            return(await _connection.QueryFirstOrDefaultAsync <T>(
                       query,
                       dynamicParameters,
                       commandType : CommandType.Text,
                       transaction : _unitOfWork.Transaction));
        }