public void SaveChanges()
 {
     using (MultithreadDbContext dbContext = new MultithreadDbContext())
     {
         dbContext.SaveChanges();
     }
 }
        //private readonly MultithreadDbContext dbContext;

        //public LinksHistoryRepositoroes(MultithreadDbContext dbContext)
        //{
        //    this.dbContext = dbContext;
        //}

        public void Add(LinksHistoryEntity linksHistoryEntity)
        {
            using (MultithreadDbContext dbContext = new MultithreadDbContext())
            {
                dbContext.Links.Add(linksHistoryEntity);
                dbContext.SaveChanges();
            }
        }
 public bool Contains(LinksHistoryEntity linksHistoryEntity)
 {
     using (MultithreadDbContext dbContext = new MultithreadDbContext())
     {
         return(dbContext.Links.Any(f =>
                                    f.Links == linksHistoryEntity.Links));
     }
 }
Esempio n. 4
0
 public ParserPages(
     MultithreadDbContext multithreadDbContext,
     ILinksHistoryRepositoroes linksHistoryRepositoroes,
     LinksHistoryServices linksHistoryServices)
 {
     this.multithreadDbContext     = multithreadDbContext;
     this.linksHistoryRepositoroes = linksHistoryRepositoroes;
     this.linksHistoryServices     = linksHistoryServices;
 }
Esempio n. 5
0
 public StartApp(
     MultithreadDbContext dbContext,
     ILinksHistoryRepositoroes linksHistoryRepositoroes,
     LinksHistoryServices linksHistoryServices,
     ParserPages parserPages)
 {
     this.dbContext = dbContext;
     this.linksHistoryRepositoroes = linksHistoryRepositoroes;
     this.linksHistoryServices     = linksHistoryServices;
     this.parserPages = parserPages;
 }