public async Task <RecordStorageTryGetResult <byte[]> > TryGetRequestBodyByIdAsync(string id) { var result = await _redis.StringGetAsync(GetRedisKey($"RecordEntry.RequestBody?{id}")); if (result.HasValue) { return(RecordStorageTryGetResult.Create(true, (byte[])result)); } else { return(RecordStorageTryGetResult.Create(false, default(byte[]))); } }
public Task <RecordStorageTryGetResult <byte[]> > TryGetResponseBodyByIdAsync(string id) { _lock.EnterReadLock(); try { var succeed = _entries.TryGetValue(id, out var value); return(Task.FromResult(RecordStorageTryGetResult.Create(succeed, value?.ResponseBody))); } finally { _lock.ExitReadLock(); } }
public async Task <RecordStorageTryGetResult <HttpRequestRecord> > TryGetDetailByIdAsync(string id) { var result = await _redis.StringGetAsync(GetRedisKey($"RecordEntry?{id}")); if (result.HasValue) { return(RecordStorageTryGetResult.Create(true, Deserialize <HttpRequestRecord>(result))); } else { return(RecordStorageTryGetResult.Create(false, default(HttpRequestRecord))); } }
public Task <RecordStorageTryGetResult <HttpRequestRecord> > TryGetDetailByIdAsync(string id) { _lock.EnterReadLock(); try { var succeed = _entries.TryGetValue(id, out var value); return(Task.FromResult(RecordStorageTryGetResult.Create(succeed, value?.Record))); } finally { _lock.ExitReadLock(); } }