protected void LinkbtnLixeiraBlog_Click(object sender, EventArgs e) { BlogDAO blogDAO = new BlogDAO(); Blog blog = new Blog(); PostDAO postDAO = new PostDAO(); Post post = new Post(); ComentarioDAO comentarioDAO = new ComentarioDAO(); Comentario comentario = new Comentario(); var list = postDAO.ObterPostsPorBlog(Convert.ToInt32(ddlListaBlogs.SelectedItem.Value)); foreach (var item in list) { DeletarUmPost(item.id); } blog.id = Convert.ToInt32(ddlListaBlogs.SelectedItem.Value); blogDAO.DeletarUm(blog); blogDAO.Dispose(); PopularListBlogs(); PopularListPost(); PopularLabelAutorPost(); PopularLabelTemaPost(); PopularLabelTextPost(); lblBlogExcluido.Visible = true; }