Beispiel #1
0
 public void Create(Eggs eggs)
 {
     using (var context = new NurseryContext())
     {
         context.Eggs.Add(eggs);
         context.SaveChanges();
     }
 }
 public void Create(AntType type)
 {
     using (var context = new NurseryContext())
     {
         context.AntTypes.Add(type);
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public IReadOnlyCollection <Eggs> Get()
 {
     using (var context = new NurseryContext())
         return(context.Eggs.ToList());
 }
 public IReadOnlyCollection <AntType> Get()
 {
     using (var context = new NurseryContext())
         return(context.AntTypes.ToList());
 }