public async Task Save(CancellationToken token) { switch (Type) { case OperationType.Budget: { var request = new CreateBudgetOperationRequest { Amount = Amount, Comment = Comment, OperationDate = OperationDate, CategoryId = CategoryId, AccountId = AccountId }; await _service.CreateBudgetOperation(request, token); break; } case OperationType.Transfer: { var request = new CreateTransferOperationRequest { Amount = Amount, Comment = Comment, OperationDate = OperationDate, From = AccountId, To = ToAccountId }; await _service.CreateTransferOperation(request, token); break; } } }
public Task <bool> CreateBudgetOperation(CreateBudgetOperationRequest request, CancellationToken token) => Post("operations/budget", request, token);