public object Delete(TypeDeleteRequest request) { IOpenSearchableElasticType type = ecf.GetOpenSearchableElasticTypeByNameOrDefault(request.IndexName, request.TypeName); NameValueCollection parameters = new NameValueCollection(); parameters.Set("uid", request.Id); var results = OpenSearchService.QueryResult(type, parameters); var response = Delete(type, results); return new HttpResult(response, "application/json"); }
public object Delete(TypeDeleteRequest request) { IOpenSearchableElasticType type = ecf.GetOpenSearchableElasticTypeByNameOrDefault(request.IndexName, request.TypeName); NameValueCollection parameters = new NameValueCollection(); parameters.Set("uid", request.Id); var results = OpenSearchService.QueryResult(type, parameters); var response = Delete(type, results); return(new HttpResult(response, "application/json")); }
public async Task <IActionResult> Delete(TypeDeleteRequest request) { if (!ModelState.IsValid) { return(View()); } var result = await _typeApiClient.DeleteType(request.Id); if (result) { TempData["result"] = "Xóa thành công"; return(RedirectToAction("Index")); } ModelState.AddModelError("", "Xóa không thành công"); return(View(request)); }