/// <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)); }
/// <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)); }
/// <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)); }
/// <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)); }