public async Task <Dictionary <string, T> > GetAsync <T>(IEnumerable <string> changeVectors, CancellationToken token = default) { using (Session.AsyncTaskHolder()) { var operation = new GetRevisionOperation(Session, changeVectors); var command = operation.CreateRequest(); await RequestExecutor.ExecuteAsync(command, Context, sessionInfo : SessionInfo, token).ConfigureAwait(false); operation.SetResult(command.Result); return(operation.GetRevisions <T>()); } }
public async Task <T> GetAsync <T>(string id, DateTime date, CancellationToken token = default) { using (Session.AsyncTaskHolder()) { var operation = new GetRevisionOperation(Session, id, date); var command = operation.CreateRequest(); await RequestExecutor.ExecuteAsync(command, Context, sessionInfo : SessionInfo, token : token).ConfigureAwait(false); operation.SetResult(command.Result); return(operation.GetRevisionsFor <T>().FirstOrDefault()); } }
public async Task <List <MetadataAsDictionary> > GetMetadataForAsync(string id, int start = 0, int pageSize = 25, CancellationToken token = default) { using (Session.AsyncTaskHolder()) { var operation = new GetRevisionOperation(Session, id, start, pageSize, true); var command = operation.CreateRequest(); await RequestExecutor.ExecuteAsync(command, Context, sessionInfo : SessionInfo, token : token).ConfigureAwait(false); operation.SetResult(command.Result); return(operation.GetRevisionsMetadataFor()); } }
public async Task <T> GetAsync <T>(string changeVector, CancellationToken token = default) { using (Session.AsyncTaskHolder()) { var operation = new GetRevisionOperation(Session, changeVector); var command = operation.CreateRequest(); await RequestExecutor.ExecuteAsync(command, Context, SessionInfo, token).ConfigureAwait(false); operation.SetResult(command.Result); return(operation.GetRevision <T>()); } }
public List <MetadataAsDictionary> GetMetadataFor(string id, int start = 0, int pageSize = 25) { var operation = new GetRevisionOperation(Session, id, start, pageSize, true); var command = operation.CreateRequest(); if (command == null) { return(operation.GetRevisionsMetadataFor()); } SessionInfo?.IncrementRequestCount(); RequestExecutor.Execute(command, Context, sessionInfo: SessionInfo); operation.SetResult(command.Result); return(operation.GetRevisionsMetadataFor()); }
public T Get <T>(string id, DateTime date) { var operation = new GetRevisionOperation(Session, id, date); var command = operation.CreateRequest(); if (command == null) { return(operation.GetRevision <T>()); } SessionInfo?.IncrementRequestCount(); RequestExecutor.Execute(command, Context, sessionInfo: SessionInfo); operation.SetResult(command.Result); return(operation.GetRevisionsFor <T>().FirstOrDefault()); }
public Dictionary <string, T> Get <T>(IEnumerable <string> changeVectors) { var operation = new GetRevisionOperation(Session, changeVectors); var command = operation.CreateRequest(); if (command == null) { return(operation.GetRevisions <T>()); } SessionInfo?.IncrementRequestCount(); RequestExecutor.Execute(command, Context, sessionInfo: SessionInfo); operation.SetResult(command.Result); return(operation.GetRevisions <T>()); }
public T Get <T>(string changeVector) { var operation = new GetRevisionOperation(Session, changeVector); var command = operation.CreateRequest(); if (command == null) { return(operation.GetRevision <T>()); } SessionInfo?.IncrementRequestCount(); RequestExecutor.Execute(command, Context, sessionInfo: SessionInfo); operation.SetResult(command.Result); return(operation.GetRevision <T>()); }
public async Task <List <T> > GetForAsync <T>(string id, int start = 0, int pageSize = 25, CancellationToken token = default) { using (Session.AsyncTaskHolder()) { var operation = new GetRevisionOperation(Session, id, start, pageSize); var command = operation.CreateRequest(); if (command == null) { return(operation.GetRevisionsFor <T>()); } SessionInfo?.IncrementRequestCount(); await RequestExecutor.ExecuteAsync(command, Context, sessionInfo : SessionInfo, token : token).ConfigureAwait(false); operation.SetResult(command.Result); return(operation.GetRevisionsFor <T>()); } }
public LazyRevisionOperation(GetRevisionOperation getRevisionOperation, Mode mode) { _getRevisionOperation = getRevisionOperation; _mode = mode; }