public async Task <IActionResult> DeleteAsync(int id)
        {
            var Status  = false;
            var Message = string.Empty;
            var Result  = new Res();

            BackgroundJob.Enqueue(() => _customerServices.Delete(id, out Status));


            await Task.Run(() => _customerServices.Delete(id, out Status));

            if (Status)
            {
                Result.Status     = true;
                Result.Message    = MesssageContant.DELETE_SUCCESS;
                Result.StatusCode = HttpStatusCode.OK;
            }
            else
            {
                Result.Data       = null;
                Result.Status     = Status;
                Result.Message    = MesssageContant.DELETE_FAIL;
                Result.StatusCode = HttpStatusCode.InternalServerError;
            }
            return(Ok(Result));
        }
        public IActionResult Delete(Customer customer)
        {
            var result = _customerServices.Delete(customer);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Пример #3
0
        // DELETE: api/Lookup/5
        public bool Delete(int id)
        {
            HttpRequestHeaders headers = Request.Headers;
            bool hardDelete            = false;

            if (headers.Contains("hard_delete"))
            {
                hardDelete = bool.Parse(headers.GetValues("hard_delete").First());
            }
            return(id > 0 && _customerServices.Delete(id, hardDelete));
        }
        public IActionResult Delete(Guid id)
        {
            var rowsAffect = _customerServices.Delete(id);

            if (rowsAffect > 0)
            {
                return(Ok(rowsAffect));
            }
            else
            {
                return(NoContent());
            }
        }
        public IActionResult Delete([FromBody] Customer customer)
        {
            try
            {
                _customerServices.Delete(customer);

                return(new NoContentResult());
            }
            catch (ArgumentException ex)
            {
                return(NotFound(ex));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }
Пример #6
0
 public IActionResult Delete(int id)
 {
     ICustomerService.Delete(id);  //IDSİ GELEN KAYITI SİL
     return(RedirectToAction("Index"));
 }
 public JsonResult Delete(string CustomerId)
 {
     _customerServices.Delete(CustomerId);
     return(Json("true", JsonRequestBehavior.AllowGet));
 }