예제 #1
0
 static void AddRabbit(Rabbit r)
 {
     using (var db = new RabbitDbContext())
     {
         db.Rabbits.Add(r);
         db.SaveChanges();
     }
 }
예제 #2
0
 static void UpdateRabbit()
 {
     using (var db = new RabbitDbContext())
     {
         var rabbitToUpdate = db.Rabbits.Find(1);
         rabbitToUpdate.RabbitName = "Molly";
         db.SaveChanges();
     }
 }