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); }
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); }
public IActionResult Post(Product product) { _productsCommand.CreateProduct(product); return(NoContent()); }