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