Ejemplo n.º 1
0
        public async Task AddDiscount()
        {
            var result = await _service.Insert(new Discount
            {
                BeginDate          = DateTime.UtcNow,
                DiscountPercentage = new decimal(.30),
                EndDate            = DateTime.UtcNow.AddDays(2),
                ProductId          = 1
            });

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Id > 0);
        }
        public async Task <ActionResult <Discount> > PostAsync([FromBody] Discount value)
        {
            var created = await _service.Insert(value);

            return(Created($"", created));
        }