public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(TelegramEntity).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TelegramEntityExists(TelegramEntity.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("../Telegram")); }
// To protect from overposting attacks, enable the specific properties you want to bind to. // For more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(BitrixUser).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BitrixUserExists(BitrixUser.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("/Account/Manage/Bitrix", new { area = "Identity" })); }
// To protect from overposting attacks, see https://aka.ms/RazorPagesCRUD public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.ItemsCategories.Add(ItemCategory); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } BitrixUser = await _context.BitrixUsers.FindAsync(id); if (BitrixUser != null) { _context.BitrixUsers.Remove(BitrixUser); await _context.SaveChangesAsync(); } return(RedirectToPage("/Account/Manage/Bitrix", new { area = "Identity" })); }