コード例 #1
0
        public IActionResult GetTotalAmount()
        {
            //store response
            var res = _coinJar.GetTotalAmount();

            return(StatusCode(res.Code, res));
        }
コード例 #2
0
ファイル: CoinJarController.cs プロジェクト: VishavP/CoinJar
 ///<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));
     }
 }
コード例 #3
0
ファイル: JarController.cs プロジェクト: lloydkammies/CoinJar
        public JsonResult GetTotalAmount()
        {
            var data = _coinJar.GetTotalAmount();

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

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