예제 #1
0
        private Product CreateProduct(int index, UserType userType, decimal price, params ProductCreditAdjustment[] adjustments)
        {
            DeleteProduct(index);

            var product = new Product
            {
                Name              = string.Format(ProductNameFormat, index),
                Description       = string.Format(ProductNameFormat, index),
                UserTypes         = userType,
                Price             = price,
                Currency          = Currency.AUD,
                CreditAdjustments = adjustments == null || adjustments.Length == 0 ? null : adjustments.ToList(),
                IsEnabled         = true,
            };

            _productsCommand.CreateProduct(product);
            return(product);
        }
예제 #2
0
        protected Product CreateProduct(int index, UserType userType, decimal price, TimeSpan?duration, params ProductCreditAdjustment[] adjustments)
        {
            DeleteProduct(index);

            var product = new Product
            {
                Name              = string.Format(ProductNameFormat, index),
                UserTypes         = userType,
                Price             = price,
                Currency          = Currency.AUD,
                CreditAdjustments = adjustments == null || adjustments.Length == 0 ? null : adjustments.ToList()
            };

            _productsCommand.CreateProduct(product);
            return(product);
        }
예제 #3
0
 public IActionResult Post(Product product)
 {
     _productsCommand.CreateProduct(product);
     return(NoContent());
 }