public async Task <string> DeleteRate(DeleterateInputDto deleterateinput) { var result = RateRepository.Delete(deleterateinput.RateId); await RateRepository.Save(); return(result); }
public async Task <IActionResult> DeleteRate([FromBody] DeleterateInputDto deleterateinput) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await RateServise.DeleteRate(deleterateinput); return(Ok(result)); }
public async Task <IActionResult> OnGet(int id) { try { deleterate = new DeleterateInputDto() { RateId = id }; var result = await rateService.DeleteRate(deleterate); State = true; return(RedirectToPage("./Rate")); } catch (Exception e) { State = false; ViewData["Error"] = e.Message; return(Page()); } }