Skip to content

Commit

Permalink
DatabaseDumpReader: Fix to remove aliasId from staff item.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoltanar committed Dec 6, 2023
1 parent 7d3a5af commit c10f5f5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions HappySearchObjectClasses/Database/StaffItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Happy_Apps_Core.Database;
public class StaffItem : DumpItem, IDataItem<int>
{
public int ID { get; set; }
public int AliasID { get; set; }
public string Gender { get; set; }
public string Language { get; set; }
public string Description { get; set; }
Expand All @@ -19,12 +18,11 @@ public class StaffItem : DumpItem, IDataItem<int>
public DbCommand UpsertCommand(DbConnection connection, bool insertOnly)
{
string sql = $"INSERT {(insertOnly ? string.Empty : "OR REPLACE ")}INTO {nameof(StaffItem)}s " +
"(ID,AID,Gender,Lang,Desc) VALUES " +
"(@ID,@AID,@Gender,@Lang,@Desc)";
"(ID,Gender,Lang,Desc) VALUES " +
"(@ID,@Gender,@Lang,@Desc)";
var command = connection.CreateCommand();
command.CommandText = sql;
command.AddParameter("@ID", ID);
command.AddParameter("@AID", AliasID);
command.AddParameter("@Gender", Gender);
command.AddParameter("@Lang", Language);
command.AddParameter("@Desc", Description);
Expand All @@ -36,7 +34,6 @@ public void LoadFromReader(IDataRecord reader)
try
{
ID = Convert.ToInt32(reader["ID"]);
AliasID = Convert.ToInt32(reader["AID"]);
Gender = Convert.ToString(reader["Gender"]);
Language = Convert.ToString(reader["Lang"]);
Description = Convert.ToString(reader["Desc"]);
Expand All @@ -51,7 +48,6 @@ public void LoadFromReader(IDataRecord reader)
public override void LoadFromStringParts(string[] parts)
{
ID = GetInteger(parts, "id", 1);
AliasID = GetInteger(parts, "aid");
Gender = GetPart(parts, "gender");
Language = GetPart(parts, "lang");
Description = GetPart(parts, "description");
Expand Down

0 comments on commit c10f5f5

Please sign in to comment.