public TValue Read(TKey key, out RequestDescription result) { UserTransaction utr = null; var ret = _api.Read(key, out utr); result = new RequestDescription(utr); if (ret == null) { result.DataNotFound(); return(default(TValue)); } return((TValue)ret); }
public async Task <AsyncReadResult <TValue> > ReadAsync(TKey key) { var innerData = await _api.ReadAsync(key); TValue data = default(TValue); if (innerData == null || innerData.Transaction == null || innerData.Transaction.UserTransaction == null) { return(new AsyncReadResult <TValue>(new RequestDescription(Errors.FailRead), data)); } var result = new RequestDescription(innerData.Transaction.UserTransaction); if (innerData.Data != null) { data = _dataProvider.DeserializeValue(innerData.Data); } else { result.DataNotFound(); } return(new AsyncReadResult <TValue>(result, data)); }