/// <summary> /// Inserts the author. /// </summary> /// <param name="author">The author.</param> /// <returns></returns> public async Task InsertAuthor(Author author) { author.Deleted = false; context.Authors.Add(author); await context.SaveChangesAsync(); }
/// <summary> /// Updates the author. /// </summary> /// <param name="author">The author.</param> /// <returns></returns> public async Task UpdateAuthor(Author author) { context.Entry(author).State = EntityState.Modified; await context.SaveChangesAsync(); }
public async Task<ActionResult> Edit(Author author) { if (ModelState.IsValid) { await _authorRepository.UpdateAuthor(author); return RedirectToAction("Index"); } return View(author); }