public bool DeleteProduct(int id)
 {
     if (repository.Delete(id))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#2
0
        public IHttpActionResult DeleteProduct(string id)
        {
            ProductAPI.core.Entities.Product product = db.GetById(id);
            if (product == null)
            {
                return(NotFound());
            }

            db.Delete(id);
            return(Ok(product));
        }
示例#3
0
 public async Task <ActionResult> DeleteProduct(string id)
 {
     return(Ok(await _productRepositories.Delete(id)));
 }