public IActionResult GetAllContacts(int page = 1, int pageSize = 4) { try { var contacts = _contactsService.GetAllContacts().OrderBy(x => x.ContactId); // Paging information is in header - Response is Data Only, Metadata is in header pageSize = AddMetaDataToHeader(page, pageSize, contacts); return(Ok(contacts.Skip(pageSize * (page - 1)).Take(pageSize))); } catch (Exception ex) { log.Error("PublicAddressBookApiError: ", ex); return(StatusCode(StatusCodes.Status500InternalServerError)); } }
/// <summary> /// Fetch the list of all the Contacts /// </summary> /// <returns>List<ContactModel></returns> public List <ContactModel> GetAllContacts() { List <ContactDO> contactDetailsDOList = _iContacts.GetAllContacts(); return(Mapper.Mapper.MapToContactModelList(contactDetailsDOList)); }
public IEnumerable <Contact> GetAllContacts(IContacts acc) { return(acc.GetAllContacts()); }