public static string getBlogContent(int BlogID) { m_BlogContext db1 = new m_BlogContext(); foreach (var t in db1.m_Blogs) { if (t.ID == BlogID) { return(t.content); } } return(""); }
public static m_Blog getBlog(int BlogID) { m_BlogContext db1 = new m_BlogContext(); foreach (var t in db1.m_Blogs) { if (t.ID == BlogID) { return(t); } } return(null); }
public static void createBlog(string BlogContent, int OwnerID, string Title) { m_BlogContext db1 = new m_BlogContext(); db1.m_Blogs.Add(new m_Blog() { ownerid = OwnerID, title = Title, content = filter(BlogContent), classify = "", last_modify_time = DateTime.Now, visit_count = 0 }); db1.SaveChanges(); }