Esempio n. 1
0
        public IActionResult GetTotalAmount()
        {
            //store response
            var res = _coinJar.GetTotalAmount();

            return(StatusCode(res.Code, res));
        }
Esempio n. 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));
     }
 }
Esempio n. 3
0
        public JsonResult GetTotalAmount()
        {
            var data = _coinJar.GetTotalAmount();

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

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