public PostService(DbContext context) : base(context) { _postsFactory = new PostsFactory(); _postsRepository = unitOfWork.Posts; _commentFactory = new CommentFactory(); _likeFactory = new LikeFactory(); }
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" }; }
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); }
public PcBuildController(IConfiguration configuration) { _pcBuildLogic = PcBuildFactory.CreateLogic(configuration); _likeLogic = LikeFactory.CreateLogic(configuration); }
public IdeasController(UserFactory uf, PostFactory pf, LikeFactory lkf) { userFactory = uf; postFactory = pf; likeFactory = lkf; }