Update GetParentByID to return a singular parent.

This commit is contained in:
kougyokugentou 2020-04-28 22:22:03 -07:00
parent 8bb23ddbc6
commit 3c61b605a4

View File

@ -124,15 +124,17 @@ namespace DBWizard
}
}
public List<Parent> GetParentByID(int parent_id)
public Parent GetParentByID(int parent_id)
{
using (IDbConnection cnn = new SQLiteConnection(LoadConnectionString()))
{
string strQuery = "SELECT * FROM parents WHERE id=@id;";
string strQuery = "SELECT * FROM parents WHERE parent_id=@id;";
var output = cnn.Query<Parent>(strQuery, new { id = parent_id });
return output.ToList();
var parList = output.ToList();
Parent parent = parList[0];
return parent;
}
}