コード例 #1
0
        protected static void Deletar(EntidadeDeBanco objeto, string nomeTabela)
        {
            if (objeto == null)
            {
                return;
            }

            DeletarPorId(objeto.Id, nomeTabela);
            objeto.Id = 0;
        }
コード例 #2
0
 protected long GetId(EntidadeDeBanco value)
 {
     if (value == null)
     {
         return(0);
     }
     else
     {
         return(value.Id);
     }
 }
コード例 #3
0
        protected static void Deletar(EntidadeDeBanco objeto, string nomeTabela)
        {
            if (objeto == null)
            {
                return;
            }

            using (IDbConnection cnn = new SQLiteConnection(GetConnectionString())) {
                cnn.Execute($"DELETE FROM {nomeTabela} WHERE Id = @Id", objeto);
                objeto.Id = 0;
            }
        }