Exemplo n.º 1
0
        public IActionResult Delete(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(NotFound(name));
            }

            if (_mProductStore.GetByName(name) == null)
            {
                return(NotFound(name));
            }

            _mProductStore.Remove(name);

            return(Ok(name));
        }
 public IEnumerable <Product> Get(string name)
 {
     Console.WriteLine(name);
     return(name == null?_store.GetAll() : _store.GetByName(name));
 }
Exemplo n.º 3
0
 public IEnumerable <Product> Get(string name)
 {
     return(name == null?_mProductStore.GetAll() : _mProductStore.GetByName(name));
 }