public async Task <IActionResult> GetCompra(long id) { try { var result = await service.Get(id); return(CreatedAtAction("GetCompra", new { id = result.IdCompra }, result)); } catch (Exception e) { var err = e.Message; return(BadRequest(new { msg = err })); } }
public IActionResult Get(int id) { return(Ok( _compraService.Get(id) )); }