Continuing work on updating a song's record whenever attributes or metadata are updated. Running into an issue where the Song record is deleted during an update after the other records have been updated (artist record, album record, genre record, etc.). I believe I have narrowed it down to the Genre id and Year Id of the song not being updated. #37

This commit is contained in:
amazing-username
2019-05-19 21:48:03 -04:00
parent 991d2e0d6a
commit c9e8e2c6da
7 changed files with 289 additions and 33 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ namespace Icarus.Models.Context
{
conn.Open();
var query = "SELECT * FROM Album WHERE Title=@Title";
_logger.Info($"Song title to rerieve album:\n{song.AlbumTitle}");
using (MySqlCommand cmd = new MySqlCommand(query, conn))
{
cmd.Parameters.AddWithValue("@Title", song.AlbumTitle);
@@ -280,7 +280,7 @@ namespace Icarus.Models.Context
using (var conn = GetConnection())
{
conn.Open();
var query = "DELETE Album WHERE AlbumId=@AlbumId";
var query = "DELETE FROM Album WHERE AlbumId=@AlbumId";
using (var cmd = new MySqlCommand(query, conn))
{
+1 -1
View File
@@ -202,7 +202,7 @@ namespace Icarus.Models.Context
{
conn.Open();
var query = "DELETE Artist WHERE ArtistId=@ArtistId";
var query = "DELETE FROM Artist WHERE ArtistId=@ArtistId";
using (var cmd = new MySqlCommand(query, conn))
{
+1 -1
View File
@@ -275,7 +275,7 @@ namespace Icarus.Models.Context
{
conn.Open();
var query = "DELETE Genre WHERE GenreId=@GenreId";
var query = "DELETE FROM Genre WHERE GenreId=@GenreId";
using (var cmd = new MySqlCommand(query, conn))
{
+1 -1
View File
@@ -273,7 +273,7 @@ namespace Icarus.Models.Context
{
conn.Open();
var query = "DELETE Year WHERE YearId=@YearId";
var query = "DELETE FROM Year WHERE YearId=@YearId";
using (var cmd = new MySqlCommand(query, conn))
{