public async Task <IActionResult> OnPostAsync(string id) { if (!ModelState.IsValid) { return(Page()); } var t = Details.Find(t => t.CarNum == CarDetail.CarNum); Details.Remove(t); const string path = @"..\车辆基本信息表.csv"; FileService.RewriteFile <CarDetail>(path, Details); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(string id) { if (id == null) { return(NotFound()); } CarDetail = Details.Find(t => t.CarNum == int.Parse(id)); if (CarDetail == null) { return(NotFound()); } return(Page()); }