//删除帖子 static void DeletePost() { BloBussinessLayer bbl = new BloBussinessLayer(); Console.WriteLine("请输入要删除的帖子:"); int id = int.Parse(Console.ReadLine()); Post post = bbl.Querypost(id); bbl.Delete(post); }
//更新帖子 static void UpdatePost() { Console.WriteLine("输入帖子Id:"); int id = int.Parse(Console.ReadLine()); BloBussinessLayer bbl = new BloBussinessLayer(); Post post = bbl.Querypost(id); Console.WriteLine("输入新的帖子:"); string content = Console.ReadLine(); string title = Console.ReadLine(); //int blogId = int.Parse(Console.ReadLine()); //post.BlogId = blogId; post.Title = title; post.Content = content; bbl.Update(post); }