public PDVServiceTest()
        {
            var databaseContext = new DatabaseContext();

            var pdvRepository = new PDVRepository(databaseContext);

            pdvService = new PDVService(pdvRepository);
        }
Example #2
0
        public IActionResult Post([FromBody] VendaViewModel vendaInformada)
        {
            try
            {
                PDVService service = new PDVService(this.context);
                VendaModel venda   = new VendaModel();
                venda = service.RegistrarVenda(vendaInformada.ValorPagar, vendaInformada.ValorPago);

                return(Ok(venda));
            }
            catch (Exception ex)
            {
                return(new ObjectResult("Something wenf wrong! - " + ex.Message)
                {
                    StatusCode = 500
                });
            }
        }
 public PDVController(PDVService pdvService)
 {
     this.pdvService = pdvService;
 }