public async Task<IActionResult> agregarProductosFacturado([FromBody] ProductoFacturado factura) { var resultado = _service.AddProductoFacturado(factura); if (await resultado) { return Ok(resultado); } else { return BadRequest(); } }
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); } }