Exemple #1
0
 //[Route("author_add")]
 public ActionResult AddAuthor()
 {
     Models.AutherModels author = new Models.AutherModels
     {
         AuthorId   = Guid.NewGuid(),
         AuthorName = "Vyasa",
         Added      = System.DateTime.UtcNow
     };
     library_repo.AddAuthor(author);
     return(View());
 }
Exemple #2
0
 public bool UpdateAuthor(Models.AutherModels author)
 {
     _context.Entry(author).State = System.Data.EntityState.Modified;
     _context.SaveChanges();
     return(true);
 }
Exemple #3
0
 public bool RemoveAuthor(Models.AutherModels author)
 {
     _context.Entry(author).State = System.Data.EntityState.Deleted;
     _context.SaveChanges();
     return(true);
 }
Exemple #4
0
 public bool AddAuthor(Models.AutherModels author)
 {
     _context.Authors.Add(author);
     _context.SaveChanges();
     return(true);
 }