예제 #1
0
 public Boolean Delete(ServiceItem serviceItem)
 {
     if (serviceItem == null || !ModelState.IsValid)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, "Invalid Request");
     }
     serviceItemService.DeleteServiceItem(serviceItem.ServiceItemId);
     return(true);
 }
        public async Task <ActionResult> DeleteServiceItem(Guid id)
        {
            var serviceItem = await _serviceServiceItem.GetServiceItemById(id);

            if (serviceItem == null)
            {
                return(BadRequest("Service n'existe pas"));
            }

            await _serviceServiceItem.DeleteServiceItem(serviceItem);

            return(NoContent());
        }
예제 #3
0
        public IHttpActionResult Delete(int serviceItemID)
        {
            var response = service.DeleteServiceItem(serviceItemID);

            return(Ok(response));
        }