示例#1
0
 public void AddComment(Comment comment)
 {
     using var ctx = new BlogDataContext(_connectionString);
     ctx.Comments.Add(comment);
     ctx.SaveChanges();
 }
示例#2
0
 public void AddPost(Post post)
 {
     using var ctx = new BlogDataContext(_connectionString);
     ctx.Posts.Add(post);
     ctx.SaveChanges();
 }