Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void StartAllertCheck()
        {
            try
            {
                using (var dbModel = new DbModelContext())
                {
                    var followInformation = GetFollowedInformation(dbModel);

                    CheckFollowedInformation(ref followInformation);

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