예제 #1
0
 //private ApplicationDbContext _context;
 //public BillRepository(ApplicationDbContext context)
 //{
 //    _context = context;
 //}
 public GoldBill CalculateBill(GoldBill bill)
 {
     if (bill != null)
     {
         float price = bill.GoldPrice * bill.Weight;
         bill.TotalPrice = price - (price * bill.Discount) / 100;
     }
     return(bill);
 }
예제 #2
0
 public IActionResult GetBill([FromBody] GoldBill bill)
 {
     bill = _bill.CalculateBill(bill);
     return(Ok(bill));
 }