private FlowComponent getCommentFooter(CommentsTableRetrieval.Row comment, UsersTableRetrieval.Row author, UpdateRegionSet deleteUpdateRegions) =>
 new GenericFlowContainer(
     new GenericFlowContainer(
         new GenericPhrasingContainer(
             new EwfHyperlink(
                 Profile.GetInfo(comment.AuthorId),
                 new ImageHyperlinkStyle(
                     new ExternalResource(
                         author.ProfilePictureUrl.Any() ? author.ProfilePictureUrl : "https://static.productionready.io/images/smiley-cyrus.jpg"),
                     "")).ToCollection())
         .Append(
             new GenericPhrasingContainer(
                 new EwfHyperlink(Profile.GetInfo(comment.AuthorId), new StandardHyperlinkStyle(author.Username)).ToCollection()))
         .Append(new GenericPhrasingContainer(comment.CreationDateAndTime.ToDayMonthYearString(false).ToComponents()))
         .Materialize()).Concat <FlowComponent>(
         comment.AuthorId == AppTools.User?.UserId
                                                 ? new EwfButton(
             new StandardButtonStyle("Delete", icon: new ActionComponentIcon(new FontAwesomeIcon("fa-trash"))),
             behavior: new PostBackBehavior(
                 postBack: PostBack.CreateIntermediate(
                     deleteUpdateRegions.ToCollection(),
                     id: PostBack.GetCompositeId("delete", comment.CommentId.ToString()),
                     modificationMethod: () => CommentsModification.DeleteRows(new CommentsTableEqualityConditions.CommentId(comment.CommentId)))))
         .ToCollection()
                                                 : Enumerable.Empty <PhrasingComponent>())
     .Materialize());
        private IReadOnlyCollection <FlowComponent> getNewCommentComponents(UpdateRegionSet createUpdateRegions)
        {
            if (AppTools.User == null)
            {
                return(new Paragraph(
                           new EwfHyperlink(
                               EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.Pages.LogIn.GetInfo(Home.GetInfo().GetUrl()),
                               new StandardHyperlinkStyle("Sign in")).Concat(" or ".ToComponents())
                           .Append(new EwfHyperlink(User.GetInfo(), new StandardHyperlinkStyle("sign up")))
                           .Concat(" to add comments on this article.".ToComponents())
                           .Materialize()).ToCollection());
            }

            commentMod = getCommentMod();
            return(FormState.ExecuteWithDataModificationsAndDefaultAction(
                       PostBack.CreateIntermediate(
                           createUpdateRegions.ToCollection(),
                           id: "comment",
                           modificationMethod: () => {
                commentMod.CommentId = MainSequence.GetNextValue();
                commentMod.Execute();
            })
                       .ToCollection(),
                       () => new FlowIdContainer(
                           commentMod.GetBodyTextTextControlFormItem(
                               false,
                               label: Enumerable.Empty <PhrasingComponent>().Materialize(),
                               controlSetup: TextControlSetup.Create(numberOfRows: 3, placeholder: "Write a comment..."),
                               value: "")
                           .ToComponentCollection()
                           .Append(new EwfButton(new StandardButtonStyle("Post Comment"))),
                           updateRegionSets: createUpdateRegions.ToCollection()).ToCollection()));
        }
        private CommentsModification getCommentMod()
        {
            var mod = CommentsModification.CreateForInsert();

            mod.AuthorId            = AppTools.User.UserId;
            mod.ArticleId           = ArticleId;
            mod.CreationDateAndTime = DateTime.UtcNow;
            return(mod);
        }