Esempio n. 1
0
 public void SaveChapData(List <Chapter> chaps)
 {
     using (CrawelNovelDbContext context = new CrawelNovelDbContext())
     {
         context.Chapter.AddRange(chaps);
         context.SaveChanges();
     }
 }
Esempio n. 2
0
 public void UpdateCatalog(Catalog cata)
 {
     using (CrawelNovelDbContext context = new CrawelNovelDbContext())
     {
         context.Catalog.Attach(cata);
         context.Entry(cata).Property("UpdateTime").IsModified = true;
         context.SaveChanges();
     }
 }
Esempio n. 3
0
        public int SaveCatalog(Catalog cata)
        {
            int returnId = 0;

            using (CrawelNovelDbContext context = new CrawelNovelDbContext())
            {
                context.Catalog.Add(cata);
                context.SaveChanges();
                returnId = cata.Id;
            }
            return(returnId);
        }