public virtual IActionResult ApiContactsByOrganisationByOrganisationIdGet([FromRoute][Required] string organisationId, [FromQuery] int?pageIndex, [FromQuery] int?pageSize)
        {
            IEnumerable <Contact> contacts;
            int totalPages;

            try
            {
                contacts = _datastore.ByOrganisation(organisationId);
                contacts = contacts.GetPagingValues(pageIndex, pageSize, out totalPages);
            }
            catch (Crm.CrmApiException ex)
            {
                return(StatusCode((int)ex.HttpStatus, ex.Message));
            }

            return(new ObjectResult(new PaginatedListContacts()
            {
                Items = contacts.ToList(),
                TotalPages = totalPages,
                PageSize = pageSize ?? Paging.DefaultPageSize,
                PageIndex = pageIndex ?? Paging.DefaultIndex
            }));
        }
 public IEnumerable <Contacts> ByOrganisation(string organisationId)
 {
     return(_filter.Filter(_datastore.ByOrganisation(organisationId)));
 }