Browse Source

Fehler berichtigt

DatenbankJonas
Jonas Schönbach 11 months ago
parent
commit
6ce6c92210
  1. 8
      Data/Repository.cs

8
Data/Repository.cs

@ -21,19 +21,17 @@ namespace BuecherwurmAPI.Data
{
using (var command = _dbConnection.CreateCommand())
{
var com = _dbConnection.CreateCommand();
com.Parameters.Add(new SqliteParameter("@Id", SqliteType.Integer)).Value = id;
command.Parameters.Add(new SqliteParameter("@Id", SqliteType.Integer)).Value = id;
// Certain parts of the query can't be filled with variables for security reasons.
switch (table)
{
case Tables.Table.Lends:
com.CommandText = @"SELECT EXISTS(SELECT 0 FROM Lends WHERE Id = @Id)";
command.CommandText = @"SELECT EXISTS(SELECT 0 FROM Lends WHERE Id = @Id)";
break;
}
var dr = com.ExecuteReader();
var dr = command.ExecuteReader();
long result = 0;
while (dr.Read())

Loading…
Cancel
Save