public ActionResult SearchModalPageData(DataTableFilter <ClientePesquisaModalFiltro> model) { IEnumerable <ClientePesquisaModalLinhaTabela> result = _unitOfWork.ClienteRepository.ObterDadosParaDataTable(model, out int recordsFiltered, out int totalRecords); //Formatando a informação de cnpj ou cpf para o datatable result.ForEach(x => x.CNPJCPF = x.CNPJCPF.CnpjOuCpf()); return(DataTableResult.FromModel(new DataTableResponseModel { Draw = model.Draw, RecordsTotal = totalRecords, RecordsFiltered = recordsFiltered, Data = Mapper.Map <IEnumerable <ClienteSearchModalItemViewModel> >(result) })); }