public static void InitializeTestData()
        {
            using (AutoReservationContext context = new AutoReservationContext())
            {
                var connection = (SqlConnection)context.Database.Connection;
                var command = new SqlCommand();
                command.Connection = connection;

                connection.Open();

                DeleteAll(command);

                // Insert Autos
                SetAutoIncrementOnTable(connection, "Auto", true);
                InsertAutos(command);
                SetAutoIncrementOnTable(connection, "Auto", false);

                // Insert Kunden
                SetAutoIncrementOnTable(connection, "Kunde", true);
                InsertKunden(command);
                SetAutoIncrementOnTable(connection, "Kunde", false);

                // Insert Reservationen
                SetAutoIncrementOnTable(connection, "Reservation", true);
                InsertReservationen(command);
                SetAutoIncrementOnTable(connection, "Reservation", false);
            }
        }
Exemple #2
0
 static void Main(string[] args)
 {
     AutoReservationContext context = new AutoReservationContext();
 }