public override Task <ChainMessage> RequestDeltaChain(DeltaRequest request, ServerCallContext context) { RegisterNode(request.SenderAddress, context); return(Task.FromResult(new ChainMessage { Xml = chainManipulator.GetChainDelta(request.CurrentIndex).AsXML() })); }
public virtual async Task <IActionResult> Delta(T1 id, DeltaRequest request) { try { return(Ok(await _historicalCrudService.Delta(id, request))); } catch (EntityNotFoundException) { return(NotFound()); } catch (NoHistoryException) { return(NoContent()); } }
// TODO: Adapt for dto object, should not present entity values public virtual async Task <object> Delta(TId id, DeltaRequest request) { if (request.From == null) { request.From = _historicalCrudReadService.GetLastTimeViewed <TEntity>(id); } if (request.To == null) { request.To = DateTime.MaxValue; } if (request.Mode == DeltaRequestModes.Snapshot) { return(await GetDeltaSnapshot(id, request.From.Value, request.To.Value)); } else if (request.Mode == DeltaRequestModes.Differential) { return(await GetDeltaDifferential(id, request.From.Value, request.To.Value)); } throw new NotImplementedException(); // TODO: Convert TEntity to TDto }
public virtual async Task <object> Delta(T1 id, DeltaRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } if (request.From == null) { request.From = GetLastTimeViewed <T2>(id); } if (request.To == null) { request.To = DateTime.MaxValue; } if (request.Mode == DeltaRequestModes.Snapshot) { return(await GetDeltaSnapshot(id, request.From.Value, request.To.Value)); } return(await GetDeltaDifferential(id, request.From.Value, request.To.Value)); }
public virtual async Task <IActionResult> Delta(Guid id, DeltaRequest request) => await((IHistoricalCrudDeltaController <Guid, T>)_controller).Delta(id, request);
public void Init() { instance = new DeltaRequest(); }
public virtual async Task <object> Delta(Guid id, DeltaRequest request) => await _service.Delta(id, request);