public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.MeasurementPoint.Add(MeasurementPoint); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Unit = await _context.Unit.FindAsync(id); if (Unit != null) { _context.Unit.Remove(Unit); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } MeasurementType = await _context.MeasurementType.FindAsync(id); if (MeasurementType != null) { _context.MeasurementType.Remove(MeasurementType); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(MeasurementType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { } return(RedirectToPage("./Index")); }