Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7998581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:14:57+00:00 2026-06-04T15:14:57+00:00

I know my question is stupid, but I dont know solution of my problem

  • 0

I know my question is stupid, but I dont know solution of my problem and can understand similar questions on stackoverflow.
I doing simple blog.
And when I go to one post in this blog I must see text of post and comments for him. They there are in my datebase, but I dont know how display both.
Please help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:14:59+00:00Added an answer on June 4, 2026 at 3:14 pm

    You can create a custom ViewModel for this particular View. Something like this:

    public class BlogReaderViewModel
    {
        // various fields which exist on either the post or the comments
    }
    

    Then you’d bind to that ViewModel for the View. The Controller action would get the Models it needs and build an instance of the ViewModel to pass to the View.

    Another option would be to use a Tuple. It’s a generic class which acts as a strongly-typed container for multiple other types. So the View’s Model would be something like this:

    Tuple<Post, Comments>
    

    From an overall design perspective, my biggest recommendation would be to consider how your Models relate to one another and find your “aggregate root.” In the case of a blog post with comments, it sounds like the post should be the aggregate root. The Model itself should have the comments within it. Something like this:

    public class BlogPost
    {
        public string Title { get; set; }
        public string Body { get; set; }
        public IEnumerable<Comment> Comments { get; set; }
    }
    

    The idea is that the aggregate root is the parent object and internally knows about its child objects. You shouldn’t have to manually compose those hierarchies of objects every time you want to use them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know, I am asking very simple and stupid question but i want to
maybe stupid question, but i dont know answer. What is difference between using GetModuleHandle
Perhaps a stupid question, but i really dont know the answer :
I know that this is a real stupid question, but I don't really understand
Maybe this is a stupid question, but I dont know how to use Membership
it might be stupid question, but I dont know the answer to it and
I know, I am asking stupid question but your experience will help me to
This may be a stupid question to ask, but still I need to know
i know this is probably a stupid question and i know js scope questions
This might be a stupid questions but I wanted to know what happens if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.