コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: CategorizedItem.cs プロジェクト: krwhite/sync
        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);
        }