public void CreateCommand(Command cmd)
        {
            if (cmd == null)
            {
                throw new ArgumentNullException(nameof(cmd));
            }

            _context.Add(cmd);
        }
Exemple #2
0
 public void CreateCommand(Command command)
 {
     if (command != null)
     {
         _context.Add(command);
     }
     else
     {
         throw new ArgumentNullException(nameof(command));
     }
 }
Exemple #3
0
        private void Seed()
        {
            using (var context = new CommanderContext(ContextOptions))
            {
                context.Database.EnsureDeleted();
                context.Database.EnsureCreated();

                var cmd = new Command {
                    HowTo = "Test create command", Line = "Test line", Platform = "test"
                };

                context.Add(cmd);

                context.SaveChanges();
            }
        }