Update GetParentByID to return a singular parent.
This commit is contained in:
parent
8bb23ddbc6
commit
3c61b605a4
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user