|
using System;
using System.Collections.Generic;
using System.Linq;
namespace ECommerceSystem.Domain
{
public class ShoppingCartSelection
{
public ShoppingCartSelection()
{
ShoppingCartSelectionId = new CompositeKey();
}
public ShoppingCartSelection(ProductDescription product, ShoppingCart cart,int quantity)
{
ShoppingCartSelectionId = new CompositeKey();
//Set the composite keys
ShoppingCartSelectionId.class1Key = product.ProductDescriptionId;
ShoppingCartSelectionId.class2Key = cart.ShoppingCartId;
//Set the associations
product.CartSelectionsWithThisProduct.Add(this);
cart.CartSelections.Add(this);
CurrentProduct = product;
ParentCart = cart;
//SetProperty
Quantity = quantity;
}
public virtual CompositeKey ShoppingCartSelectionId { get; set; }
public virtual ProductDescription CurrentProduct { get; set; }
public virtual ShoppingCart ParentCart { get; set; }
public virtual int Quantity { get; set; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.