//更新博客id static void Update() { BlogBusinessLayer bbl = new BlogBusinessLayer(); Console.WriteLine("请输入id"); int id = int.Parse(Console.ReadLine()); Blog blog = bbl.Query(id); Console.Write("请输入新博客名:"); string name = Console.ReadLine(); blog.Name = name; bbl.Update(blog); }
//更新博客 static void Update() { QueryBlog(); Console.WriteLine("请输入需要修改的博客id"); int id = int.Parse(Console.ReadLine()); BlogBusinessLayer bbl = new BlogBusinessLayer(); Blog blog = bbl.Query(id); Console.WriteLine("请输入博客新名字"); string name = Console.ReadLine(); blog.Name = name; bbl.Update(blog); Console.Clear(); selectBlog(); }