I have a Post class for a website representing posts made on the website.
Each post is part of a category, and I have a corresponding Category class.
How would I relate posts to categories? By letting the post have an int CategoryId or a Category Category?
I have a Post class for a website representing posts made on the website.
Share
I do both. This allows full navigation of the caterogy from post, but also gives you the foreign key if that is all you need.