Skip to main content

Marketplace Entities

Entities for marketplace listings where users can buy/sell fishing gear.

MarketplaceListing

Purpose: Marketplace listings - users can buy/sell gear.

Key Fields:

  • Id (Guid): Unique identifier
  • SellerUserId: Seller user
  • Title: Listing title
  • Description: Listing description
  • ListingType: Sale, Trade, Wanted, Free
  • Price: Listing price
  • Currency: Currency code
  • IsNegotiable: Whether price is negotiable
  • Condition: New, LikeNew, Used, Poor
  • RodId, ReelId, LureId, LineId: Linked gear (optional)
  • Location: Listing location
  • Latitude, Longitude: Coordinates
  • AllowsShipping: Whether allows shipping
  • AllowsLocalPickup: Whether allows local pickup
  • Status: Active, Sold, Expired, Removed
  • ViewCount: View count
  • CreatedAt, UpdatedAt: Timestamps

Relationships:

  • Many-to-one: User (seller)
  • Many-to-one: Rod, Reel, Lure, Line (optional)

Usage Patterns:

// Create marketplace listing
var listing = new MarketplaceListing
{{
SellerUserId = userId,
Title = "Shimano Stradic 5000",
Description = "Like new condition, used twice",
ListingType = ListingType.Sale,
Price = 150.00m,
Condition = ItemCondition.LikeNew,
ReelId = reelId,
Location = "Milwaukee, WI",
AllowsShipping = true,
AllowsLocalPickup = true,
Status = ListingStatus.Active
}};

// Get active listings
var listings = context.MarketplaceListings
.Where(ml => ml.Status == ListingStatus.Active)
.Include(ml => ml.SellerUser)
.Include(ml => ml.Rod)
.Include(ml => ml.Reel)
.OrderByDescending(ml => ml.CreatedAt)
.ToList();