public async Task <ActionResult> Delete(int id)
 {
     if (await _service.Delete(id))
     {
         return(Ok());
     }
     return(BadRequest());
 }
Exemple #2
0
        public async Task <IActionResult> Delete([FromQuery] int resourceId)
        {
            var outputHandler = await _service.Delete(resourceId);

            if (outputHandler.IsErrorOccured)
            {
                return(BadRequest(outputHandler.Message));
            }

            return(Ok(outputHandler.Message));
        }
Exemple #3
0
 public IActionResult DeleteResource(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (Exception ex)
     {
         var e = ex.GetBaseException();
         return(BadRequest(new { msg = e.Message }));
     }
 }
        public IActionResult DeleteResource(int id)
        {
            try
            {
                var resource = _resourceService.GetById(id);

                _resourceService.Delete(id);
                Utils.DeleteData(resource.Code);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(new { resource = ex.Message }));
            }
        }
        public override IHttpActionResult Delete(string request)
        {
            var delete = _service.Delete(request);

            return(Ok(delete));
        }
Exemple #6
0
 public async Task <ApiResponse <Domain.Models.Resource> > DeleteResource([FromRoute] Guid guid)
 {
     return(await _ResourceService.Delete(guid));
 }
        public IActionResult Delete(long id)
        {
            _resourceService.Delete(id);

            return(Ok());
        }
Exemple #8
0
 public void Delete(int id)
 {
     _resourceService.Delete(id);
 }
 public Task <IResultModel> Delete([BindRequired] string id)
 {
     return(_service.Delete(id));
 }