public async Task <IActionResult> Edit(int id, [Bind("Id,Time,Value,TickerId")] Divendender.Models.Indicators.RSI rSI) { if (id != rSI.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rSI); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RSIExists(rSI.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["TickerId"] = new SelectList(_context.Tickers, "Id", "Id", rSI.TickerId); return(View(rSI)); }
public async Task <IActionResult> Create([Bind("Id,Time,Value,TickerId")] Divendender.Models.Indicators.RSI rSI) { if (ModelState.IsValid) { _context.Add(rSI); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TickerId"] = new SelectList(_context.Tickers, "Id", "Id", rSI.TickerId); return(View(rSI)); }