예제 #1
0
 public PostService(DbContext context) : base(context)
 {
     _postsFactory    = new PostsFactory();
     _postsRepository = unitOfWork.Posts;
     _commentFactory  = new CommentFactory();
     _likeFactory     = new LikeFactory();
 }
예제 #2
0
 public void TestInitialize()
 {
     _logic   = LikeFactory.CreateTestLogic();
     _build   = new PcBuild("test _build", new List <PcPart>(), 0, 0, "1");
     _account = new Account("testuser", "1234", "1234")
     {
         Id = "1"
     };
 }
예제 #3
0
        public ActionResult GetBlog(string id)
        {
            List <SelectListItem> funds = new List <SelectListItem>();
            ContentFactory        cf    = new ContentFactory();
            var topicList = cf.GetTopic(Convert.ToInt64(id));
            var topicData = topicList.Select(m => new SelectListItem()
            {
                Text  = m.TopicName,
                Value = m.TopicId.ToString(),
            });
            var  topic   = topicList[0];
            long TopicID = topic.TopicId;
            List <BlogEntity> BlogByTopic = new List <BlogEntity>();

            BlogByTopic   = cf.GetBlogByTopicId(TopicID);
            ViewBag.Blogs = BlogByTopic;
            CommentFactory       cmf         = new CommentFactory();
            List <CommentEntity> ListComment = new List <CommentEntity>();

            ListComment      = cmf.GetComment();
            ViewBag.Comments = ListComment;

            LikeFactory       lf       = new LikeFactory();
            List <LikeEntity> ListLike = new List <LikeEntity>();

            ListLike      = lf.GetLike();
            ViewBag.Likes = ListLike;

            List <CommentEntity> Comment = new List <CommentEntity>();
            string s = string.Empty;

            foreach (var item in BlogByTopic)
            {
                s += item.BlogId + ",";
            }


            return(PartialView("_LoadBlogs"));

            //return Json(topicData, JsonRequestBehavior.AllowGet);
        }
예제 #4
0
 public PcBuildController(IConfiguration configuration)
 {
     _pcBuildLogic = PcBuildFactory.CreateLogic(configuration);
     _likeLogic    = LikeFactory.CreateLogic(configuration);
 }
예제 #5
0
 public IdeasController(UserFactory uf, PostFactory pf, LikeFactory lkf)
 {
     userFactory = uf;
     postFactory = pf;
     likeFactory = lkf;
 }