public void Seed() { if (_context.Departament.Any() || _context.SalesRecord.Any() || _context.Saller.Any()) { return; } Departament d1 = new Departament(new int(), "Eletronics"); Departament d2 = new Departament(new int(), "Ferramentas"); Saller s1 = new Saller(new int(), "Danilo", "*****@*****.**", new DateTime(1999, 3, 12), 1234.00, d1); Saller s2 = new Saller(new int(), "Tais", "*****@*****.**", new DateTime(1999, 3, 12), 1234.00, d2); SalesRecord w1 = new SalesRecord(new int(), new DateTime(23, 11, 12), 1200.00, SalesStatus.Pending, s1); SalesRecord w2 = new SalesRecord(new int(), new DateTime(23, 11, 12), 1100.00, SalesStatus.Billed, s2); _context.Departament.AddRange(d1, d2); _context.Saller.AddRange(s1, s2); _context.SalesRecord.AddRange(w1, w2); _context.SaveChanges(); }
public void Save() { _context.SaveChanges(); }
public int SaveChanges() { return(Db.SaveChanges()); }
public bool Commit() { return(_appVendasContext.SaveChanges() > 0); }