示例#1
0
 public void Seed()
 {
     if (_context.Pacient.Any() || _context.Disease.Any())
     {
         return;
     }
     else
     {
         Pacient initial = new Pacient(1, "Paulo");
         Disease second  = new Disease(1, "preguiça", DateTime.Now);
         _context.Disease.AddRange(second);
         _context.Pacient.AddRange(initial);
         _context.SaveChanges();
     }
 }
示例#2
0
 public void Insert(Pacient pacient)
 {
     _context.Pacient.Add(pacient);
     _context.SaveChanges();
 }
示例#3
0
 public void Insert(Disease disease)
 {
     _context.Disease.Add(disease);
     _context.SaveChanges();
 }