public ProductViewModel(Product product)
        {
            _product = product;

            //var scenarioTitle = string.Empty;
            //const string linkFormat = "/Scenarios/Details/{0}";

            /*
            foreach (var cardSet in product.CardSets)
            {
                foreach (var card in cardSet.Cards.Where(x => (x.CardType == CardType.Quest || (x.EncounterSet != null && x.EncounterSet.EndsWith("Nightmare"))) && !string.IsNullOrEmpty(x.EncounterSet)))
                {
                    scenarioTitle = !string.IsNullOrEmpty(card.ScenarioTitle) ? card.ScenarioTitle : card.EncounterSet;

                    if (!_scenarios.Any(x => x.Title == scenarioTitle))
                    {
                        _scenarios.Add(new ScenarioViewModel { Title = scenarioTitle, Link = string.Format(linkFormat, scenarioTitle.ToUrlSafeString()) });
                    }
                }
            }*/
        }
示例#2
0
 protected void AddProduct(Product product)
 {
     ChildProducts.Add(product);
 }