Example #1
0
        public void Remove_Gets_Removed()
        {
            var newYeast = new Yeast {
                Name = "newYeast" + DateTime.Now.Ticks, ProductCode = "AAA", Type = "Liquid", Custom = true
            };

            _yeastRepository.Add(newYeast);
            _yeastRepository.Remove(newYeast);
            var yeasts = _yeastRepository.GetAll();

            Assert.True(yeasts.All(o => o.YeastId != newYeast.YeastId));
        }
        public IActionResult Remove(string oid)
        {
            var yeast = _yeastRepository.Find(x => x.Oid == new Guid(oid));

            if (yeast == null)
            {
                return(NotFound());
            }

            _yeastRepository.Remove(yeast);

            return(Ok());
        }
Example #3
0
        public async Task <IActionResult> Remove([FromRoute] int yeastId)
        {
            var yeasts = await _yeastRepository.Remove(yeastId);

            return(Ok(yeasts));
        }