Upon save/update failure - no way to get Id
Closed this issue · 0 comments
charlessolar commented
When saving using the multi puts if something goes wrong there doesn't seem to be a way to get the RiakObjectId from the failed RiakResult.
For instance:
var options = new RiakPutOptions
{
IfNoneMatch = true,
IfNotModified = false,
ReturnHead = true,
ReturnBody = false
};
options.SetW(Quorum.WellKnown.Quorum);
var saved = await _client.Async.Put(_saves, options);
foreach(var failure in saved.Where(x => !x.IsSuccess))
{
// ? failure.Id
// ? failure.Key
}
I even tried to hack it together by doing this:
for(var i = 0; i < saved.Count(); i++){
if(!saved.ElementAt(i).IsSuccess)
_saved.ElementAt(i).Key // the one that failed!
}
But it seems the result is not kept in order because i'm getting incorrect reports of keys :(