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