예제 #1
0
        public ActionResult PostTransacao([FromBody] Transacao transacao)
        {
            Transacao T = new Transacao();

            int t1 = 0;
            int t2 = 0;

            t1 = T.ValorPagar;
            t2 = T.ValorPago;



            T.calculatroco(t1, t2);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Resultado.Add(transacao);
            _context.SaveChanges();

            return(CreatedAtAction("GetTransacao", transacao));
        }