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

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

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

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