Exemplo n.º 1
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            try
            {
                var product = await _repository.GetProductAsync(id);

                _repository.Deleteproduct(product);

                if (await _repository.SaveChangesAsync())
                {
                    return(Ok());
                }
                else
                {
                    return(InternalServerError());
                }
            }
            catch
            {
                return(InternalServerError());
            }
        }