Blog.Tools.ApplicationSetup.Program.LoadComments C# (CSharp) 메소드

LoadComments() 개인적인 정적인 메소드

private static LoadComments ( ) : void
리턴 void
		private static void LoadComments()
		{
			foreach (var p in _posts)
			{
				for (var i = 1; i < 4; i++)
				{
					CommentRepository.Add(new Comment
					{
						CommentMessage = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.",
						PostId = p.PostId,
						ParentCommentId = null,
						CreatedBy = i,
						CreatedDate = DateTime.Now.AddHours(-i),
						ModifiedBy = p.User.UserId,
						ModifiedDate = DateTime.Now.AddHours(-i),
						UserId = i,
						CommentLocation = "Makati City, Philippines"
					});
				}
			}

			var tc = CommentRepository.Find(a => a.CommentId > 0, true).ToList();
			foreach (var c in tc)
			{
				foreach (var u in _users)
				{
					CommentRepository.Add(new Comment
					{
						CommentMessage = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.",
						PostId = null,
						ParentCommentId = c.CommentId,
						CreatedBy = u.UserId,
						CreatedDate = DateTime.Now.AddHours(-1),
						ModifiedBy = u.UserId,
						ModifiedDate = DateTime.Now.AddHours(-1),
						UserId = u.UserId,
						CommentLocation = "Makati City, Philippines"
					});
				}
			}

			_comments = CommentRepository.Find(a => a.CommentId > 0 && a.ParentCommentId == null, q => q.OrderByDescending(p => p.CreatedDate),
				"Comments,User,CommentLikes,ParentComment").ToList();

			AddConsoleMessage("Successfully added comments and comment replies...");
		}