public async Task <IActionResult> Edit(string id, [Bind("Id,appid,appkey,SMSAppName,Describe")] SMSApp sMSApp) { if (id != sMSApp.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sMSApp); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SMSAppExists(sMSApp.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sMSApp)); }
public async Task <IActionResult> Create([Bind("Id,appid,appkey,SMSAppName,Describe")] SMSApp sMSApp) { if (ModelState.IsValid) { _context.Add(sMSApp); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sMSApp)); }