예제 #1
0
 public static void AddPublisher(Publisher publisher)
 {
     using (LibraryDataContext ctx = new LibraryDataContext())
     {
         ctx.Publishers.Add(publisher);
         ctx.SaveChanges();
     }
 }
예제 #2
0
 public static void UpdatePublisher(Publisher persistentPublisher)
 {
     using (LibraryDataContext ctx = new LibraryDataContext())
     {
         ctx.Publishers.Attach(persistentPublisher);
         ctx.Entry(persistentPublisher).State = System.Data.Entity.EntityState.Modified;
         ctx.SaveChanges();
     }
 }