예제 #1
0
 public async Task<IActionResult> agregarProductosFacturado([FromBody] ProductoFacturado factura)
 {
     var resultado = _service.AddProductoFacturado(factura);
     if (await resultado)
     {
         return Ok(resultado);
     }
     else
     {
         return BadRequest();
     }
 }
예제 #2
0
        public async Task <bool> AddProductoFacturado(ProductoFacturado ProductoFacturado)
        {
            try
            {
                if (ProductoFacturado != null)
                {
                    await _context.AddAsync(ProductoFacturado);
                }
                _context.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(false);
            }
        }