Example #1
0
 /// <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();
 }
Example #2
0
 /// <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();
 }
Example #3
0
 public async Task<ActionResult> Edit(Author author)
 {
     if (ModelState.IsValid)
     {
         await _authorRepository.UpdateAuthor(author);
         return RedirectToAction("Index");
     }
     return View(author);
 }