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); }
public void StartAllertCheck() { try { using (var dbModel = new DbModelContext()) { var followInformation = GetFollowedInformation(dbModel); CheckFollowedInformation(ref followInformation); dbModel.SaveChanges(); } } catch (Exception ex) { } }
public void Commit() { dbContext.SaveChanges(); }
public void InsertBank(Bank b) { db.Banks.Add(b); db.SaveChanges(); }
public void Add(T item) { _context.Set <T>().Add(item); _context.SaveChanges(); }