Ejemplo n.º 1
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            GebruikerMSSQLContext mssqlContext = new GebruikerMSSQLContext();
            Gebruiker             gebruiker    = await mssqlContext.GetByNaam("Testgebruiker");

            return(View(gebruiker));
        }
Ejemplo n.º 2
0
        public async Task <IViewComponentResult> InvokeAsync(int reviewId)
        {
            ReactieMSSQLContext   reactieMSSQLContext   = new ReactieMSSQLContext();
            ReviewMSSQLContext    reviewMSSQLContext    = new ReviewMSSQLContext();
            GebruikerMSSQLContext gebruikerMSSQLContext = new GebruikerMSSQLContext();

            Review review = reviewMSSQLContext.GetReviewById(reviewId);

            reactieLijst = await reactieMSSQLContext.GetAllByReview(review);

            gesorteerdeReactieLijst = new List <Reactie>();

            foreach (Reactie reactie in reactieLijst.Where(x => x.ReactieOpReactieId == null))
            {
                gesorteerdeReactieLijst.Add(reactie);
                WalkTreeNode(reactie);
            }

            ReactieViewModel reactieViewModel =
                new ReactieViewModel
            {
                Review       = review,
                Gebruikers   = gebruikerMSSQLContext.GetAll(),
                ReactieLijst = gesorteerdeReactieLijst
            };

            return(View(reactieViewModel));
        }
        public async Task <IViewComponentResult> InvokeAsync()
        {
            PostMSSQLContext      mssqlContext     = new PostMSSQLContext();
            GebruikerMSSQLContext gebruikerContext = new GebruikerMSSQLContext();

            Gebruiker gebruiker = await gebruikerContext.GetByNaam(HttpContext.User.Identity.Name);

            List <Post> interessantePosts = mssqlContext.GetInteressantePosts(gebruiker.GebruikerId);

            return(View(interessantePosts));
        }