public void OnGet() { var comment = _articleService.GetCommentById(Id); Model = new DisplayCommentModel { Content = comment.Content, DatePublished = comment.DatePublished, Author = comment.Author }; }
public async Task <IViewComponentResult> InvokeAsync(DisplayCommentModel comment) { return(await Task.FromResult((IViewComponentResult)View("CommentSection", comment))); }
private void InitializeTestData(out Game game, out Publisher publisher, out DisplayCommentModel displayComment, out GameViewModel gameViewModel, out FilterDataModel filterDataModel) { var gameBuilder = new GameBuilder(); publisher = new Publisher { CompanyName = "name", Description = "description", HomePage = "homepage", Id = Guid.NewGuid(), IsDeleted = false, Languages = new List <PublisherTranslation>() }; displayComment = new DisplayCommentModel { Body = "body", ChildrenComments = new List <DisplayCommentModel>(), CommentId = Guid.NewGuid(), GameKey = "c21", Name = "name", Quote = "quote" }; game = gameBuilder.WithId(new Guid("2245390a-6aaa-4191-35f5-08d7223464b8")).WithKey("c21") .WithName("Cry Souls").WithDescription("Cry Souls desc").WithUnitsInStock(10).WithPrice(10).WithPublisher("Unknown").Build(); game.Publisher = _publisher; game.GamePlatforms = new List <GamePlatform> { new GamePlatform() }; game.GameGenres = new List <GameGenre> { new GameGenre() }; gameViewModel = new GameViewModel { Description = "Desc", DescriptionRu = "Desc ru", Discontinued = false, GameGenres = new List <string>(), GamePlatforms = new List <string>(), IsDeleted = false, Key = "key", Name = "name", NameRu = "name ru", Price = 1 }; filterDataModel = new FilterDataModel { CurrentPage = 1, Genres = new List <string>(), ItemsPerPage = 10, Platforms = new List <string>(), PriceFrom = 0, PriceTo = 0, Publishers = new List <string>(), ReleaseDate = ReleaseDate.LastMonth, SearchString = "search", SortType = SortType.MostCommented }; }