Social Entities
Entities for social features including posts, comments, likes, forums, and mentorship.
Post
Purpose: Social media posts - users can share fishing experiences, photos, tips, etc.
Key Fields:
Id(Guid): Unique identifierUserId: Author of the postContent: Post text contentLocation: Optional location textPostType: Text, Photo, Video, Link, etc.Visibility: Public, Private, Circle, FriendsStatus: PendingReview, Approved, Rejected (moderation)FishingLogEntryId: Optional link to fishing log entryLikeCount,CommentCount,ShareCount: Denormalized engagement countsCreatedAt,PublishedAt: Timestamps
Relationships:
- Many-to-one: User (author)
- Many-to-one: FishingLogEntry (optional)
- One-to-many: PostMedia, PostLike, Comment, CircleShare
Usage Patterns:
// Create a post
var post = new Post
{{
UserId = userId,
Content = "Caught a huge bass today!",
PostType = PostType.Photo,
Visibility = PostVisibility.Public,
Status = PostStatus.PendingReview
}};
// Get user's posts
var posts = context.Posts
.Where(p => p.UserId == userId && p.Status == PostStatus.Approved)
.Include(p => p.User)
.Include(p => p.Media)
.OrderByDescending(p => p.CreatedAt)
.ToList();
Comment
Purpose: Comments on posts with support for nested replies.
Key Fields:
Id(int): Unique identifierUserId: Comment authorPostId: Associated postContent: Comment textParentCommentId: For nested repliesLikeCount: Denormalized countCreatedAt,UpdatedAt: Timestamps
Relationships:
- Many-to-one: User, Post
- Many-to-one: Comment (parent comment for replies)
- One-to-many: Comment (replies)
- One-to-many: CommentLike
Usage Patterns:
// Create comment
var comment = new Comment
{{
UserId = userId,
PostId = postId,
Content = "Great catch!",
ParentCommentId = null // Top-level comment
}};
// Get nested comments
var comments = context.Comments
.Where(c => c.PostId == postId && c.ParentCommentId == null)
.Include(c => c.Replies)
.Include(c => c.User)
.ToList();
PostLike
Purpose: User likes on posts.
Key Fields:
UserId: User who likedPostId: Post that was likedCreatedAt: When liked
Relationships:
- Many-to-one: User, Post
Usage Patterns:
// Like a post
var like = new PostLike
{{
UserId = userId,
PostId = postId,
CreatedAt = DateTime.UtcNow
}};
// Check if user liked post
var hasLiked = context.PostLikes
.Any(pl => pl.UserId == userId && pl.PostId == postId);
PostMedia
Purpose: Media attachments (photos, videos) for posts.
Key Fields:
Id(int): Unique identifierPostId: Associated postMediaUrl: URL to media fileMediaType: Photo, Video, etc.Order: Display orderCaption: Optional caption
Relationships:
- Many-to-one: Post
Forum
Purpose: Discussion forums for topics.
Key Fields:
Id(int): Unique identifierName: Forum nameDescription: Forum descriptionCategory: Forum categoryIsActive: Whether forum is active
Relationships:
- One-to-many: ForumPost
ForumPost
Purpose: Posts within forums.
Key Fields:
Id(int): Unique identifierForumId: Associated forumUserId: Post authorTitle: Post titleContent: Post contentIsPinned: Whether post is pinnedViewCount: View countReplyCount: Reply count
Relationships:
- Many-to-one: Forum, User
Mentorship
Purpose: Mentorship relationships between users.
Key Fields:
Id(int): Unique identifierMentorId: Mentor userMenteeId: Mentee userStatus: Pending, Active, Completed, CancelledStartedAt,EndedAt: Relationship dates
Relationships:
- Many-to-one: User (mentor and mentee)
Related Documentation
- Social Features - Circle sharing and privacy
- Content Moderation - Post moderation system