예제 #1
0
        private void ParseProducts(DbModelContext dbContext)
        {
            int counter = 0;

            do
            {
                Thread.Sleep(3 * 1000);

                if (products.Count > 0)
                {
                    var currentProduct = products[counter];
                    parser.GetProduct(ref currentProduct);
                    counter++;

                    try
                    {
                        dbContext.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        GenericLogger.Error($"Error when trying to save changes for updating process for {currentProduct.Url}, \n ex : {ex.Message} \n {ex.StackTrace} \n {ex.InnerException.InnerException.Message}");
                    }
                }
            } while (counter < products.Count);
        }
예제 #2
0
        public void StartAllertCheck()
        {
            try
            {
                using (var dbModel = new DbModelContext())
                {
                    var followInformation = GetFollowedInformation(dbModel);

                    CheckFollowedInformation(ref followInformation);

                    dbModel.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }
        }
예제 #3
0
 public void Commit()
 {
     dbContext.SaveChanges();
 }
예제 #4
0
 public void InsertBank(Bank b)
 {
     db.Banks.Add(b);
     db.SaveChanges();
 }
예제 #5
0
 public void Add(T item)
 {
     _context.Set <T>().Add(item);
     _context.SaveChanges();
 }