Ejemplo n.º 1
0
        public List <ContactModel> GetTaggedContacts(int tagId, int companyId, int currentPage, Int16 pageSize, ref int totalRecords)
        {
            List <ContactModel> listContactModel = new List <ContactModel>();
            List <Contact>      listContacts     = new List <Contact>();


            totalRecords = contactRepository.Count(x => x.ContactTags.Where(c => c.TagId == tagId).Count() > 0 && x.CompanyId == companyId && x.RecordDeleted == false);

            listContacts = contactRepository.GetPagedRecords(x => x.ContactTags.Where(c => c.TagId == tagId).Count() > 0 && x.CompanyId == companyId && x.RecordDeleted == false, y => y.FirstName, currentPage, pageSize).ToList();


            AutoMapper.Mapper.Map(listContacts, listContactModel);

            return(listContactModel);
        }