public RiakResponse<RiakContent> Persist(RiakPersistRequest request) { var connection = _connectionManager.GetNextConnection(); var r = connection.WriteWith(request.ProxyRequest(), RequestMethod.Perist); if (r.ResponseCode == RiakResponseCode.Failed) { return RiakResponse<RiakContent>.WithErrors(r.Messages); } var response = connection.Read<PersistResponse>(); if (response.ResponseCode == RiakResponseCode.Failed) { return RiakResponse<RiakContent>.WithErrors(r.Messages); } return response.Result == null || response.Result.VectorClock == null ? RiakResponse<RiakContent>.WithErrors("Connection was successful but persist failed") : RiakResponse<RiakContent>.WithoutErrors(response.Result.Content.FirstOrDefault()); }
public RiakResponse<RiakContent> Persist(Action<RiakPersistRequest> predicate) { var request = new RiakPersistRequest(); predicate(request); return Persist(request); }