public async Task <IActionResult> Edit(int id, [Bind("ID,access_token,token_type,expire_date")] YelpAuthToken yelpAuthToken) { if (id != yelpAuthToken.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(yelpAuthToken); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!YelpAuthTokenExists(yelpAuthToken.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(yelpAuthToken)); }
public async Task <IActionResult> Create([Bind("ID,access_token,token_type,expire_date")] YelpAuthToken yelpAuthToken) { if (ModelState.IsValid) { _context.Add(yelpAuthToken); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(yelpAuthToken)); }