Ejemplo n.º 1
0
        private static Product CreateProduct(string name, List<Organization> organizations,
      decimal singlePrice, decimal doublePrice,
      decimal triplePrice, decimal quadPrice)
        {
            var product = new Product
            {
              Name = name,
              Organizations = organizations,
              ProductVariants = new List<ProductVariant>
            {
              new ProductVariant
                {
                  Name = "Single",
                  DisplayName = "Single",
                  PluralDisplayName = "Singles",
                  Description = "1 person in the room",
                  Price = singlePrice
                },
              new ProductVariant
                {
                  Name = "Double",
                  DisplayName = "Double",
                  PluralDisplayName = "Doubles",
                  Description = "2 people in the room",
                  Price = doublePrice,
                  IsMaster = true
                },
              new ProductVariant
                {
                  Name = "Triple",
                  DisplayName = "Triple",
                  PluralDisplayName = "Triples",
                  Description = "3 people in the room",
                  Price = triplePrice
                },
              new ProductVariant
                {
                  Name = "Quad",
                  DisplayName = "Quad",
                  PluralDisplayName = "Quads",
                  Description = "4 people in the room",
                  Price = quadPrice
                },
            }
            };

              return product;
        }
 public IEnumerable<ProductVariant> ProductVariants(Product product)
 {
     return product.ProductVariants;
 }