Example #1
0
 public void UpdateAuthor(Author authorUpdated)
 {
     Author author = context.Author.Where(c => c.Id == authorUpdated.Id).FirstOrDefault();
     if (author != null)
     {
         author.Name = authorUpdated.Name;
         author.LastName = authorUpdated.LastName;
         author.IdCountry = authorUpdated.IdCountry;
         context.SaveChanges();
     }
 }
Example #2
0
 public void DeleteAuthor(Author a)
 {
     context.Author.Remove(a);
     context.SaveChanges();
 }
Example #3
0
 public void AddAuthor(Author a)
 {
     context.Author.Add(a);
     context.SaveChanges();
 }