Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Fixes to the three Tag Mechanism sets of routes SQL statments
Browse files Browse the repository at this point in the history
The tables called in the SQL statements were for some reason Mecanism_TagMechanism instead of the proper tables.

Affects MechTagMechList and the two TagMech Reaction and Species Lists.
  • Loading branch information
ecyr20 committed Mar 25, 2024
1 parent 2d8874c commit 7609534
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Services/MechTagMechListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public async Task<IReadOnlyList<MechTagMechList>> GetMechTagMechsAsync()
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = "SELECT * FROM Mechanism_TagMechanism";
command.CommandText = "SELECT * FROM Mechanism_TagMechanism_List";
return await ReadAllAsync(await command.ExecuteReaderAsync());
}

Expand All @@ -21,7 +21,7 @@ public async Task<IReadOnlyList<MechTagMechList>> GetMechTagMechsAsync()
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id";
command.CommandText = @"SELECT * FROM Mechanism_TagMechanism_List WHERE uuid = @id";
command.Parameters.AddWithValue("@id", uuid);

var result = await ReadAllAsync(await command.ExecuteReaderAsync());
Expand All @@ -35,7 +35,7 @@ public async Task CreateMechTagMechAsync(MechTagMechList newMechTagMech)

Guid mechTagMechID = Guid.NewGuid();

command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, mechanism_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @mechanism_uuid, @tag_mechanism_uuid, @version);";
command.CommandText = @"INSERT INTO Mechanism_TagMechanism_List (uuid, mechanism_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @mechanism_uuid, @tag_mechanism_uuid, @version);";

command.Parameters.AddWithValue("@uuid", mechTagMechID);
command.Parameters.AddWithValue("@mechanism_uuid", newMechTagMech.mechanism_uuid);
Expand All @@ -49,7 +49,7 @@ public async Task UpdateMechTagMechAsync(MechTagMechList mechTagMech)
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET mechanism_uuid = @mechanism_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";
command.CommandText = @"UPDATE Mechanism_TagMechanism_List SET mechanism_uuid = @mechanism_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", mechTagMech.uuid);
command.Parameters.AddWithValue("@mechanism_uuid", mechTagMech.mechanism_uuid);
Expand All @@ -65,7 +65,7 @@ public async Task DeleteMechTagMechAsync(Guid uuid)
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;";
command.CommandText = @"UPDATE Mechanism_TagMechanism_List SET isDel = 1 WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", uuid);

Expand Down
10 changes: 5 additions & 5 deletions Services/TagMechanismReactionListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public async Task<IReadOnlyList<TagMechanismReactionList>> GetTagMechanismReacti
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = "SELECT * FROM Mechanism_TagMechanism";
command.CommandText = "SELECT * FROM TagMechanism_Reaction_List";
return await ReadAllAsync(await command.ExecuteReaderAsync());
}

Expand All @@ -21,7 +21,7 @@ public async Task<IReadOnlyList<TagMechanismReactionList>> GetTagMechanismReacti
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id";
command.CommandText = @"SELECT * FROM TagMechanism_Reaction_List WHERE uuid = @id";
command.Parameters.AddWithValue("@id", uuid);

var result = await ReadAllAsync(await command.ExecuteReaderAsync());
Expand All @@ -35,7 +35,7 @@ public async Task CreateTagMechanismReactionAsync(TagMechanismReactionList newTa

Guid tagMechanismReactionID = Guid.NewGuid();

command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, reaction_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @reaction_uuid, @tag_mechanism_uuid, @version);";
command.CommandText = @"INSERT INTO TagMechanism_Reaction_List (uuid, reaction_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @reaction_uuid, @tag_mechanism_uuid, @version);";

command.Parameters.AddWithValue("@uuid", tagMechanismReactionID);
command.Parameters.AddWithValue("@reaction_uuid", newTagMechanismReaction.reaction_uuid);
Expand All @@ -49,7 +49,7 @@ public async Task UpdateTagMechanismReactionAsync(TagMechanismReactionList tagMe
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET reaction_uuid = @reaction_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";
command.CommandText = @"UPDATE TagMechanism_Reaction_List SET reaction_uuid = @reaction_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", tagMechanismReaction.uuid);
command.Parameters.AddWithValue("@reaction_uuid", tagMechanismReaction.reaction_uuid);
Expand All @@ -65,7 +65,7 @@ public async Task DeleteTagMechanismReactionAsync(Guid uuid)
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;";
command.CommandText = @"UPDATE TagMechanism_Reaction_List SET isDel = 1 WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", uuid);

Expand Down
10 changes: 5 additions & 5 deletions Services/TagMechanismSpeciesListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public async Task<IReadOnlyList<TagMechanismSpeciesList>> GetTagMechanismSpecies
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = "SELECT * FROM Mechanism_TagMechanism";
command.CommandText = "SELECT * FROM TagMechanism_Species_List";
return await ReadAllAsync(await command.ExecuteReaderAsync());
}

Expand All @@ -21,7 +21,7 @@ public async Task<IReadOnlyList<TagMechanismSpeciesList>> GetTagMechanismSpecies
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"SELECT * FROM Mechanism_TagMechanism WHERE uuid = @id";
command.CommandText = @"SELECT * FROM TagMechanism_Species_List WHERE uuid = @id";
command.Parameters.AddWithValue("@id", uuid);

var result = await ReadAllAsync(await command.ExecuteReaderAsync());
Expand All @@ -35,7 +35,7 @@ public async Task CreateTagMechanismSpeciesAsync(TagMechanismSpeciesList newTagM

Guid tagMechanismSpeciesID = Guid.NewGuid();

command.CommandText = @"INSERT INTO Mechanism_TagMechanism (uuid, species_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @species_uuid, @tag_mechanism_uuid, @version);";
command.CommandText = @"INSERT INTO TagMechanism_Species_List (uuid, species_uuid, tag_mechanism_uuid, version) VALUES (@uuid, @species_uuid, @tag_mechanism_uuid, @version);";

command.Parameters.AddWithValue("@uuid", tagMechanismSpeciesID);
command.Parameters.AddWithValue("@species_uuid", newTagMechanismSpecies.species_uuid);
Expand All @@ -49,7 +49,7 @@ public async Task UpdateTagMechanismSpeciesAsync(TagMechanismSpeciesList tagMech
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET species_uuid = @species_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";
command.CommandText = @"UPDATE TagMechanism_Species_List SET species_uuid = @species_uuid, tag_mechanism_uuid = @tag_mechanism_uuid, version = @version, isDel = @isDel WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", tagMechanismSpecies.uuid);
command.Parameters.AddWithValue("@species_uuid", tagMechanismSpecies.species_uuid);
Expand All @@ -65,7 +65,7 @@ public async Task DeleteTagMechanismSpeciesAsync(Guid uuid)
using var connection = await database.OpenConnectionAsync();
using var command = connection.CreateCommand();

command.CommandText = @"UPDATE Mechanism_TagMechanism SET isDel = 1 WHERE uuid = @uuid;";
command.CommandText = @"UPDATE TagMechanism_Species_List SET isDel = 1 WHERE uuid = @uuid;";

command.Parameters.AddWithValue("@uuid", uuid);

Expand Down

0 comments on commit 7609534

Please sign in to comment.