public async Task Update(SilentProtocolEntry entry) { await _dbConnection.ExecuteAsync( "update t_silent_protocol_entries set suspect = @suspect, entry = @entry, time_stamp = @timeStamp where id = @id", new { id = entry.Id, suspect = entry.Suspect, entry = entry.Entry, timeStamp = entry.TimeStamp, }); }
public async Task Save(SilentProtocolEntry entry) { await _dbConnection.ExecuteAsync( "insert into t_silent_protocol_entries values (@id, @suspect, @entry, @timeStamp, @createdAt, @reporter)", new { id = entry.Id, suspect = entry.Suspect, entry = entry.Entry, timeStamp = entry.TimeStamp, createdAt = entry.CreatedAtUtc, reporter = entry.Reporter, }); }
private async Task LogUpdate(SilentProtocolEntry entry) { var user = _requestContext.User(); await _connection.ExecuteAsync( "insert into audit_log values (@id, @userId, @userName, @type, @info, @timestamp)", new { id = Guid.NewGuid().ToString(), userId = user.Id, userName = user.Name, type = "update", info = entry.ToString(), timestamp = DateTime.UtcNow, }); }
public static SilentProtocolEntryViewModel ToViewModel(this SilentProtocolEntry entry) =>
public async Task Update(SilentProtocolEntry entry) { await LogUpdate(entry); await _subject.Update(entry); }
public async Task Save(SilentProtocolEntry entry) { await LogSaving(entry); await _subject.Save(entry); }
/// <inheritdoc /> public async Task Save(SilentProtocolEntry entry) { await _dbContext.Entries.AddAsync(entry); await _dbContext.SaveChangesAsync(); }