public async Task <IActionResult> Delete(int Id) { var CurrentUser = await _userManager.GetUserAsync(User); if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString())) { if (await _checkProvider.CheckIfRecordExists("ContentTypes", "ContentTypeID", Id) == 0) { return(BadRequest(new { IsSuccess = false, Message = "No record with this ID", })); } var x = await _contentTypeProvider.DeleteGet(CurrentUser.Id, Id); return(Ok(x)); } return(BadRequest(new { IsSuccess = false, Message = "No rights", })); }