public async Task Update(CancellationToken token) { switch (Type) { case OperationType.Budget: { var request = new UpdateBudgetOperationRequest { Amount = Amount, Comment = Comment, CategoryId = CategoryId, AccountId = AccountId }; await _service.UpdateBudgetOperation(Id, request, token); break; } case OperationType.Transfer: { var request = new UpdateTransferOperationRequest() { Amount = Amount, Comment = Comment, From = AccountId, To = ToAccountId }; await _service.UpdateTransferOperation(Id, request, token); break; } } }
public Task <bool> UpdateTransferOperation(int id, UpdateTransferOperationRequest request, CancellationToken token) => Put($"operations/transfer/{id}", request, token);