/// <summary>
        ///
        /// </summary>
        /// <param name="criteria"></param>
        /// <param name="connection"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public IEnumerable <UserAttributeItemEntity> Get(UserAttributeItemsCriteria criteria, DbConnection connection, DbTransaction transaction)
        {
            var reader = default(KandaDbDataReader);

            try
            {
                reader = UserAttributeItemsGateway.Select(criteria, connection, transaction);

                var gotten = KandaDbDataMapper.MapToEnumerable <UserAttributeItemEntity>(reader);

                return(gotten);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public IEnumerable <UserAttributeItemEntity> Get(UserAttributeItemEntity entity, DbConnection connection, DbTransaction transaction)
        {
            var reader = default(DbDataReader);

            try
            {
                reader = UserAttributeItemsGateway.Select(entity, connection, transaction);

                var entities = KandaDbDataMapper.MapToEnumerable <UserAttributeItemEntity>(reader);

                return(entities);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <param name="connection"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public UserAttributeItemEntity Find(int id, DbConnection connection, DbTransaction transaction)
        {
            var reader = default(KandaDbDataReader);

            try
            {
                reader = UserAttributeItemsGateway.Select(new UserAttributeItemsCriteria()
                {
                    ID = id, Enabled = null,
                }, connection, transaction);
                var found = (reader.Read() ? KandaDbDataMapper.MapToObject <UserAttributeItemEntity>(reader) : UserAttributeItemEntity.Empty);

                return(found);
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }