Beispiel #1
0
        /// <summary>
        /// Deletes a <see cref="ReadCondition" /> attached to the <see cref="DataReader" />. Since <see cref="QueryCondition" /> specializes <see cref="ReadCondition" /> it can
        /// also be used to delete a <see cref="QueryCondition" />.
        /// </summary>
        /// <remarks>
        /// If the <see cref="ReadCondition" /> is not attached to the <see cref="DataReader" />, the operation will return the error <see cref="ReturnCode.PreconditionNotMet" />.
        /// </remarks>
        /// <param name="condition">The <see cref="ReadCondition" /> to be deleted.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode DeleteReadCondition(ReadCondition condition)
        {
            if (condition == null)
            {
                return(ReturnCode.Ok);
            }

            ReturnCode ret = UnsafeNativeMethods.DeleteReadCondition(_native, condition.ToNative());

            if (ret == ReturnCode.Ok)
            {
                _conditions.Remove(condition);
            }

            return(ret);
        }