コード例 #1
0
        public void AddDigikalaBasePage(DigikalaPageBaseDTO dto)
        {
            DigikalaBasePage model = new DigikalaBasePage();

            model.CreateDate   = DateTime.Now;
            model.ChangeFreq   = dto.ChangeFreq;
            model.ImageCaption = dto.ImageCaption;
            model.ImageLoc     = dto.ImageLoc;
            model.Loc          = dto.Loc;
            model.Priority     = dto.Priority;

            digikalaBasePages.Insert(model);
        }
コード例 #2
0
        public void AddDigikalaBasePages(List <DigikalaPageBaseDTO> dtos)
        {
            List <DigikalaBasePage> models = new List <DigikalaBasePage>();
            DateTime CreateDate            = DateTime.Now;

            foreach (var dto in dtos)
            {
                DigikalaBasePage model = new DigikalaBasePage();
                model.DKP          = dto.DKP;
                model.Crawled      = false;
                model.CreateDate   = CreateDate;
                model.ChangeFreq   = dto.ChangeFreq;
                model.ImageCaption = dto.ImageCaption;
                model.ImageLoc     = dto.ImageLoc;
                model.Loc          = dto.Loc;
                model.Priority     = dto.Priority;
                model.CrawlDate    = null;
                models.Add(model);
            }

            digikalaBasePages.InsertBatch(models);
        }