public async Task <ActionResult <IEnumerable <PhoneBook> > > Get()
        {
            var products = await _productRepository.Get();

            if (products == null)
            {
                return(NotFound());
            }
            return(Ok(products));
        }
示例#2
0
        public PhoneBookOutDTO Get(int id)
        {
            var user = _phoneBookRepository.Get(id);

            return(UserToPhoneBookConverter(user));
        }
示例#3
0
        public bool Delete(int?phoneBookId)
        {
            var entry = _phoneBookRepo.Get(u => u.Id == phoneBookId, _context);

            return(entry != null?_phoneBookRepo.Delete(entry, _context) : false);
        }