Example #1
0
        public async Task <IActionResult> Delete([FromBody] Barang barang)
        {
            try
            {
                await _barang.Delete(barang);

                return(Ok(barang));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Example #2
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _Barang.Delete(id);

                return(Ok("Data berhasil didelete"));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }