Skip to main content

Group Entities

Entities for fishing groups/communities based on interests, location, etc.

Group

Purpose: Fishing groups/communities - users can join groups based on interests, location, etc.

Key Fields:

  • Id (Guid): Unique identifier
  • OwnerUserId: Group owner/creator
  • Name: Group name
  • Description: Group description
  • CoverImageUrl, ProfileImageUrl: Group images
  • GroupType: Public, Private, Secret
  • Category: Bass Fishing, Ice Fishing, Location-based, etc.
  • Location: Group location (for location-based groups)
  • Latitude, Longitude: Location coordinates
  • RadiusKm: Radius for location-based groups
  • RequiresApproval: Whether membership requires approval
  • IsActive: Whether group is active
  • MemberCount: Denormalized member count
  • PostCount: Denormalized post count

Relationships:

  • Many-to-one: User (owner)
  • One-to-many: GroupMember, GroupPost

Usage Patterns:

// Create group
var group = new Group
{{
OwnerUserId = userId,
Name = "Milwaukee Bass Anglers",
GroupType = GroupType.Public,
Category = "Bass Fishing",
Location = "Milwaukee, WI",
RequiresApproval = false,
IsActive = true
}};

// Get public groups
var groups = context.Groups
.Where(g => g.GroupType == GroupType.Public && g.IsActive)
.Include(g => g.OwnerUser)
.ToList();

GroupMember

Purpose: Group membership relationships.

Key Fields:

  • Id (int): Unique identifier
  • GroupId: Associated group
  • UserId: Member user
  • Role: Member, Admin, Moderator
  • Status: Active, Pending, Banned
  • JoinedAt: Join date

Relationships:

  • Many-to-one: Group, User

Usage Patterns:

// Join group
var member = new GroupMember
{{
GroupId = groupId,
UserId = userId,
Role = GroupRole.Member,
Status = GroupMemberStatus.Active,
JoinedAt = DateTime.UtcNow
}};

// Get group members
var members = context.GroupMembers
.Where(gm => gm.GroupId == groupId && gm.Status == GroupMemberStatus.Active)
.Include(gm => gm.User)
.ToList();

GroupPost

Purpose: Posts within groups.

Key Fields:

  • Id (int): Unique identifier
  • GroupId: Associated group
  • UserId: Post author
  • Content: Post content
  • IsPinned: Whether post is pinned
  • LikeCount, CommentCount: Engagement counts
  • CreatedAt: Post timestamp

Relationships:

  • Many-to-one: Group, User

Usage Patterns:

// Create group post
var post = new GroupPost
{{
GroupId = groupId,
UserId = userId,
Content = "Great fishing today!",
CreatedAt = DateTime.UtcNow
}};

// Get group posts
var posts = context.GroupPosts
.Where(gp => gp.GroupId == groupId)
.Include(gp => gp.User)
.OrderByDescending(gp => gp.CreatedAt)
.ToList();