예제 #1
0
        public void AddHorse(string name)
        {
            //create an object to be INSERTED
            Horse horse = new Horse(name);

            _context.Horses.Add(horse);
            _context.SaveChanges();
        }
예제 #2
0
        public void AddQuote(string text)
        {
            //create an object to be INSERTED
            Quote quote = new Quote(text);

            _context.Quotes.Add(quote);
            _context.SaveChanges();
        }
예제 #3
0
 public Samurai AddSamurai(Samurai samurai)
 {
     context.Samurais.Add(samurai);
     context.SaveChanges();
     return(context.Samurais.OrderByDescending(x => x.Id).FirstOrDefault());
 }
예제 #4
0
 public void AddSamurai(Samurai samurai)
 {
     context.Add(samurai);
     context.SaveChanges();
 }
예제 #5
0
 public Battle AddBattle(Battle battle)
 {
     context.Battles.Add(battle);
     context.SaveChanges();
     return(context.Battles.OrderByDescending(x => x.Id).FirstOrDefault());
 }