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 identifierOwnerUserId: Group owner/creatorName: Group nameDescription: Group descriptionCoverImageUrl,ProfileImageUrl: Group imagesGroupType: Public, Private, SecretCategory: Bass Fishing, Ice Fishing, Location-based, etc.Location: Group location (for location-based groups)Latitude,Longitude: Location coordinatesRadiusKm: Radius for location-based groupsRequiresApproval: Whether membership requires approvalIsActive: Whether group is activeMemberCount: Denormalized member countPostCount: 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 identifierGroupId: Associated groupUserId: Member userRole: Member, Admin, ModeratorStatus: Active, Pending, BannedJoinedAt: 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 identifierGroupId: Associated groupUserId: Post authorContent: Post contentIsPinned: Whether post is pinnedLikeCount,CommentCount: Engagement countsCreatedAt: 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();
Related Documentation
- Social Features - Circle sharing system
- Social Entities - Post and comment system