public bool Delete(IOpstiDomenskiObjekat objekat) { try { connection.Open(); transaction = connection.BeginTransaction(); SqlCommand command = new SqlCommand(); command.Connection = connection; command.Transaction = transaction; command.CommandText = $"delete from {objekat.Table()} {objekat.Where()}"; if (command.ExecuteNonQuery() == 0) { throw new Exception(); } transaction.Commit(); return(true); } catch (Exception e) { Console.WriteLine(e.Message); transaction.Rollback(); return(false); } finally { connection.Close(); } }