Skip to main content

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 identifier
  • UserId: Author of the post
  • Content: Post text content
  • Location: Optional location text
  • PostType: Text, Photo, Video, Link, etc.
  • Visibility: Public, Private, Circle, Friends
  • Status: PendingReview, Approved, Rejected (moderation)
  • FishingLogEntryId: Optional link to fishing log entry
  • LikeCount, CommentCount, ShareCount: Denormalized engagement counts
  • CreatedAt, 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 identifier
  • UserId: Comment author
  • PostId: Associated post
  • Content: Comment text
  • ParentCommentId: For nested replies
  • LikeCount: Denormalized count
  • CreatedAt, 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 liked
  • PostId: Post that was liked
  • CreatedAt: 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 identifier
  • PostId: Associated post
  • MediaUrl: URL to media file
  • MediaType: Photo, Video, etc.
  • Order: Display order
  • Caption: Optional caption

Relationships:

  • Many-to-one: Post

Forum

Purpose: Discussion forums for topics.

Key Fields:

  • Id (int): Unique identifier
  • Name: Forum name
  • Description: Forum description
  • Category: Forum category
  • IsActive: Whether forum is active

Relationships:

  • One-to-many: ForumPost

ForumPost

Purpose: Posts within forums.

Key Fields:

  • Id (int): Unique identifier
  • ForumId: Associated forum
  • UserId: Post author
  • Title: Post title
  • Content: Post content
  • IsPinned: Whether post is pinned
  • ViewCount: View count
  • ReplyCount: Reply count

Relationships:

  • Many-to-one: Forum, User

Mentorship

Purpose: Mentorship relationships between users.

Key Fields:

  • Id (int): Unique identifier
  • MentorId: Mentor user
  • MenteeId: Mentee user
  • Status: Pending, Active, Completed, Cancelled
  • StartedAt, EndedAt: Relationship dates

Relationships:

  • Many-to-one: User (mentor and mentee)