Example #1
0
 public Topic Create(Post firstPost)
 {
     firstPost.CreatedBy = userServiceInstance.CurrentUser();
     firstPost.Topic.CreatedBy = userServiceInstance.CurrentUser();
     using (CommunityDbContext db = new CommunityDbContext())
     {
         db.Posts.Add(firstPost);
         db.Topics.Add(firstPost.Topic);
         db.SaveChanges();
     }
     return firstPost.Topic;
 }
Example #2
0
 public ActionResult New(Post firstPost)
 {
     _topicInstance.Create(firstPost);
     return View();
 }