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)); }
public IEnumerable <Product> Get(string name) { return(name == null?_mProductStore.GetAll() : _mProductStore.GetByName(name)); }