Exemplo n.º 1
0
        public async Task <Product> DeleteAsync(int?id)
        {
            await _repository.DeleteAsync(id);

            await _repositoryChanges.SubmitChangesAsync();

            return(null);
        }
        public async Task <ActionResult <Product> > DeleteAsync(int?id)
        {
            var response = await _repository.DeleteAsync(id);

            if (response != null)
            {
                await _serviceBus.SendMessage(response, "delete");

                await _repositoryChanges.SubmitChangesAsync();

                return(NoContent());
            }
            return(NotFound());
        }