public IActionResult GetTotalAmount()
        {
            //store response
            var res = _coinJar.GetTotalAmount();

            return(StatusCode(res.Code, res));
        }
Exemple #2
0
 ///<remarks>
 ///Gets the total amount of money in the coinjar
 ///</remarks>
 public ActionResult <decimal> GetTotalAmount()
 {
     try
     {
         return(Ok(_coinJar.GetTotalAmount()));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
        public JsonResult GetTotalAmount()
        {
            var data = _coinJar.GetTotalAmount();

            return(Json(new { status = "Success", data }, JsonRequestBehavior.AllowGet));
        }
Exemple #4
0
 public IActionResult Get()
 {
     _logger.LogInformation("Getting total amount of coins");
     return(Ok(new { TotalAmount = $"${CoinJar.GetTotalAmount().ToString("0.00")}" }));
 }
Exemple #5
0
 protected override GetTotalAmountQueryResponse Handle(GetTotalAmountQuery query)
 {
     return(new GetTotalAmountQueryResponse {
         TotalAmount = _db.GetTotalAmount()
     });
 }
Exemple #6
0
        public JsonResult GetTotalCoins()
        {
            var result = _coinJarService.GetTotalAmount();

            return(Json("Total Amount in Coin Jar: $" + result / 100));
        }