public Task PurgeAndRecordLogEvent([FromBody] LogEventsModel logEvents) { var command = LogEventReceived.Purge(_context.DeviceId); if (logEvents != null) { command = LogEventReceived.HavingDetails( _context.DeviceId, logEvents, purgeExisting: true); } return(_messagingSrv.SendAsync(command)); }
/// <summary> /// Creates a command containing a set of log events for a device. /// </summary> /// <param name="logEvents">Device log events.</param> /// <param name="purgeExisting">Indicates that any existing events associated with /// the device should be deleted before inserting the new events.</param> /// <returns>Created command.</returns> public static LogEventReceived HavingDetails(Guid deviceId, LogEventsModel logEvents, bool purgeExisting = false) =>
public Task RecordLogEvent([FromBody] LogEventsModel logEvents) { var command = LogEventReceived.HavingDetails(_context.DeviceId, logEvents); return(_messagingSrv.SendAsync(command)); }