Exemple #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var obj = await _service.GetByIdAsync(id);

            if (obj == null)
            {
                return(NotFound());
            }
            try
            {
                await _service.RemoveAsync(obj);

                return(new NoContentResult());
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }