示例#1
0
        /// <summary>
        /// Asynchronously updates an existing log record using data from the specified <see cref="ActivityDataLog" />.
        /// </summary>
        /// <param name="dataLog">The <see cref="ActivityDataLog" />.</param>
        /// <exception cref="ArgumentNullException"><paramref name="dataLog" /> is null.</exception>
        public void UpdateAsync(ActivityDataLog dataLog)
        {
            if (dataLog == null)
            {
                throw new ArgumentNullException(nameof(dataLog));
            }

            LogTableDefinition table  = DataLogTranslator.BuildTableDefinition(dataLog);
            LogTableRecord     record = DataLogTranslator.BuildUpdateRecord(dataLog);

            Task.Factory.StartNew(() => Update(table, record));
        }
示例#2
0
        /// <summary>
        /// Asynchronously submits the specified <see cref="FrameworkDataLog" /> as a new log record.
        /// </summary>
        /// <param name="dataLog">The <see cref="FrameworkDataLog" />.</param>
        /// <exception cref="ArgumentNullException"><paramref name="dataLog" /> is null.</exception>
        public void SubmitAsync(FrameworkDataLog dataLog)
        {
            if (dataLog == null)
            {
                throw new ArgumentNullException(nameof(dataLog));
            }

            LogTableDefinition table  = DataLogTranslator.BuildTableDefinition(dataLog);
            LogTableRecord     record = DataLogTranslator.BuildInsertRecord(dataLog);

            Task.Factory.StartNew(() => Submit(table, record));
        }
示例#3
0
        /// <summary>
        /// Updates an existing log record using data from the specified <see cref="ActivityDataLog" />.
        /// </summary>
        /// <param name="dataLog">The <see cref="ActivityDataLog" />.</param>
        /// <returns><c>true</c> if update was successful, <c>false</c> otherwise.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="dataLog" /> is null.</exception>
        public bool Update(ActivityDataLog dataLog)
        {
            if (dataLog == null)
            {
                throw new ArgumentNullException(nameof(dataLog));
            }

            LogTableDefinition table  = DataLogTranslator.BuildTableDefinition(dataLog);
            LogTableRecord     record = DataLogTranslator.BuildUpdateRecord(dataLog);

            return(Update(table, record));
        }
示例#4
0
        /// <summary>
        /// Submits the specified <see cref="FrameworkDataLog" /> as a new log record.
        /// </summary>
        /// <param name="dataLog">The <see cref="FrameworkDataLog" />.</param>
        /// <returns><c>true</c> if submission was successful, <c>false</c> otherwise.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="dataLog" /> is null.</exception>
        public bool Submit(FrameworkDataLog dataLog)
        {
            if (dataLog == null)
            {
                throw new ArgumentNullException(nameof(dataLog));
            }

            LogTableDefinition table  = DataLogTranslator.BuildTableDefinition(dataLog);
            LogTableRecord     record = DataLogTranslator.BuildInsertRecord(dataLog);

            return(Submit(table, record));
        }