/// <summary> /// Full constructor /// </summary> public CategorizedItem(string username, Category category, Item item) { this.username = username; this.category = category; this.item = item; // Set key values id = new CategorizedItemId(category.Id, item.Id); // Guarantee referential integrity category.CategorizedItems.Add(this); item.CategorizedItems.Add(this); }
private readonly string username; // This could also be an association to User #endregion Fields #region Constructors /// <summary> /// Full constructor /// </summary> public CategorizedItem(string username, Category category, Item item) { this.username = username; this.category = category; this.item = item; // Set key values id = new CategorizedItemId(category.Id, item.Id); // Guarantee referential integrity category.CategorizedItems.Add(this); item.CategorizedItems.Add(this); }