public async Task <IActionResult> Delete([FromBody] Barang barang) { try { await _barang.Delete(barang); return(Ok(barang)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> Delete(int id) { try { await _Barang.Delete(id); return(Ok("Data berhasil didelete")); } catch (Exception ex) { return(BadRequest(ex.Message)); } }