public GetAttachmentsResponse GetAllAttachments(GetAttachmentsRequest request) { GetAttachmentsResponse response = new GetAttachmentsResponse(); IEnumerable <Attachment> attachments = attachmentRepository.FindAllAttachments(request.ContactId, request.OpportunityID, request.Page, request.Limit, request.PageNumber); AttachmentActivityAnalyzer analyser = new AttachmentActivityAnalyzer(attachments, request.DateFormat); response.Attachments = Mapper.Map <IEnumerable <Attachment>, IEnumerable <AttachmentViewModel> >(analyser.GenerateAnalysis()); response.TotalRecords = attachmentRepository.TotalNumberOfAttachments(request.ContactId, request.OpportunityID, request.Page); return(response); }