Beispiel #1
0
        //Edit wallet
        public async Task <WalletResponse> EditWalletItem(EditWalletRequest req)
        {
            string jsonRequest  = CommonService.JsonSerializer <EditWalletRequest>(req);
            string jsonResponse = await PostRequest(jsonRequest, "editwalletitem", req.WalletID);

            return(CommonService.JsonDeSerializer <WalletResponse>(jsonResponse));
        }
        public async Task EditWalletAsync(EditWalletRequest request)
        {
            var entity = await GetWalletEntityByIdAsync(request.WalletId);

            entity.Name          = request.Name;
            entity.Description   = request.Description;
            entity.LastUpdatedOn = request.UpdatedOn;

            var baseTransactionEntity = entity.Transactions.OrderBy(t => t.Id).First();

            baseTransactionEntity.Amount = request.BaseTransactionAmount;

            await DbContext.SaveChangesAsync();
        }