public void CreateCommand(Command cmd) { if (cmd == null) { throw new ArgumentNullException(nameof(cmd)); } _context.Add(cmd); }
public void CreateCommand(Command command) { if (command != null) { _context.Add(command); } else { throw new ArgumentNullException(nameof(command)); } }
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(); } }