diff --git a/Program.cs b/Program.cs index 56fbe96..9aa4daa 100644 --- a/Program.cs +++ b/Program.cs @@ -18,20 +18,25 @@ public class Program { using (var connection = new SqliteConnection(connectionString)) { - connection.Open(); - try - { - Database.Database.CreateDatabaseQuery(connection); - } - catch + connection.Open(); + try { - Console.WriteLine("Database already exists."); + Database.Database.CreateDatabaseQuery(connection); + } + catch + { + Console.WriteLine("Database already exists."); } - - using (var command = connection.CreateCommand()) - { + + using (var command = connection.CreateCommand()) + { // implment stuff here idc + AuthorDto author = Team2.Team2.AddAuthor(connection, "John", "Doe", new DateTime(1990, 1, 1)); + AuthorDto getAuthor = Team4.Team4.GetAuthorById(connection, author.Id); + + + } } diff --git a/src/team1.cs b/src/team1.cs index 01af8e1..8e84137 100644 --- a/src/team1.cs +++ b/src/team1.cs @@ -5,6 +5,7 @@ namespace Team1 { class Library { + private SqliteConnection connection; public Library(SqliteConnection connection) { this.connection = connection; diff --git a/src/team4.cs b/src/team4.cs index a08c679..299a9bc 100644 --- a/src/team4.cs +++ b/src/team4.cs @@ -223,7 +223,7 @@ namespace Team4 using (var command = conn.CreateCommand()) { command.CommandText = @" - SELECT author.ID + SELECT * FROM Authors author WHERE author.ID = @aid;"; command.Parameters.AddWithValue("@aid", authorID);