Example #1
0
        public async Task <ResponseResult> DeleteDebugDataByIdAsync(DeleteSingleDebugDataByIdViewModel model)
        {
            ResponseResult responseResult = new ResponseResult();
            StringContent  content        = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");

            using (var response = await httpClient.PostAsync("api/debug/delete", content))
            {
                string apiResponse = await response.Content.ReadAsStringAsync();

                responseResult = JsonConvert.DeserializeObject <ResponseResult>(apiResponse);
            }
            return(responseResult);
        }
        public async Task <IActionResult> Delete([FromBody] DeleteSingleDebugDataByIdViewModel model)
        {
            try
            {
                await context.Database.ExecuteSqlCommandAsync(SPDebug.DeleteDebugDataById, model.Id);

                return(Ok(new ResponseResult(200)));
            }

            catch (Exception ex)
            {
                return(BadRequest(new ResponseResult(400, ex.Message)));
            }
        }
        public async Task <IActionResult> DeleteDebugDataByIdAsync([FromBody] DeleteSingleDebugDataByIdViewModel model)
        {
            var result = await debugService.DeleteDebugDataByIdAsync(model);

            return(Json(new { statusCode = result.StatusCode }));
        }