static void Main(string[] args) { var siteStateContext = new SiteStateContext(); //set to Draft State siteStateContext.Approve(); //from Draft to Approved State //context.SoldOut(); var productStatuscontext = new ProductStateContext(siteStateContext); //set to Passive State productStatuscontext.Approve(); //from Passive to Active State //Sold the product siteStateContext.SoldOut(); productStatuscontext.SoldOut(); }
public PassiveState(ProductStateContext productStateContext, SiteStateContext siteStatusContext = null) { _productStateContext = productStateContext; _siteStatusContext = siteStatusContext; }
public ActiveState(ProductStateContext productStateContext) { _productStateContext = productStateContext; }