public async Task <IActionResult> PutCurrency(int id, Currency currency) { if (id != currency.CurrencyId) { return(BadRequest()); } _context.Entry(currency).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CurrencyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCryptoItem(long id, CryptoItem item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,Name,TimeStamp,Message")] Comment comment) { return(View("ErrorAuth")); if (ModelState.IsValid) { db.Entry(comment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(comment)); }
public void Remove(T obj) { db.Entry(obj).State = EntityState.Deleted; db.BulkSaveChanges(); }