public List <IResearchInvestigationEntity> Adapt(DataTable dt)
        {
            List <IResearchInvestigationEntity> results = new List <IResearchInvestigationEntity>();

            foreach (DataRow rw in dt.Rows)
            {
                IResearchInvestigationEntity matchCode = new IResearchInvestigationEntity();
                matchCode = AdaptItem(rw, dt);
                results.Add(matchCode);
            }
            return(results);
        }
        public IResearchInvestigationEntity AdaptItem(DataRow rw, DataTable dt)
        {
            IResearchInvestigationEntity result = new IResearchInvestigationEntity();

            if (dt.Columns.Contains("ResearchRequestId"))
            {
                result.ResearchRequestId = SafeHelper.GetSafeint(rw["ResearchRequestId"]);
            }

            if (dt.Columns.Contains("RequestType"))
            {
                result.RequestType = SafeHelper.GetSafestring(rw["RequestType"]);
            }

            if (dt.Columns.Contains("UserId"))
            {
                result.UserId = SafeHelper.GetSafeint(rw["UserId"]);
            }

            if (dt.Columns.Contains("InputId"))
            {
                result.InputId = SafeHelper.GetSafeint(rw["InputId"]);
            }

            if (dt.Columns.Contains("CaseId"))
            {
                result.CaseId = SafeHelper.GetSafeint(rw["CaseId"]);
            }

            if (dt.Columns.Contains("SrcRecordId"))
            {
                result.SrcRecordId = SafeHelper.GetSafestring(rw["SrcRecordId"]);
            }

            if (dt.Columns.Contains("Tags"))
            {
                result.Tags = SafeHelper.GetSafestring(rw["Tags"]);
            }

            if (dt.Columns.Contains("RequestBody"))
            {
                result.RequestBody    = SafeHelper.GetSafestring(rw["RequestBody"]);
                result.RequestBodylst = JsonConvert.DeserializeObject <ResearchInvestigationRequestEntity>(result.RequestBody);
            }
            if (dt.Columns.Contains("RequestDateTime"))
            {
                result.RequestDateTime = SafeHelper.GetSafeDateTime(rw["RequestDateTime"]);
            }

            if (dt.Columns.Contains("LastestStatusDateTime"))
            {
                result.LastestStatusDateTime = SafeHelper.GetSafeDateTime(rw["LastestStatusDateTime"]);
            }

            if (dt.Columns.Contains("RequestResponseJSON"))
            {
                result.RequestResponseJSON    = SafeHelper.GetSafestring(rw["RequestResponseJSON"]);
                result.RequestResponseJSONlst = JsonConvert.DeserializeObject <ResearchInvestigationResponseEntity>(result.RequestResponseJSON);
            }
            if (dt.Columns.Contains("CaseStatus"))
            {
                result.CaseStatus = SafeHelper.GetSafestring(rw["CaseStatus"]);
            }

            if (dt.Columns.Contains("ResolutionDUNS"))
            {
                result.ResolutionDUNS = SafeHelper.GetSafestring(rw["ResolutionDUNS"]);
            }

            if (dt.Columns.Contains("CaseResolution"))
            {
                result.CaseResolution = SafeHelper.GetSafestring(rw["CaseResolution"]);
            }

            if (dt.Columns.Contains("CaseSubResolution"))
            {
                result.CaseSubResolution = SafeHelper.GetSafestring(rw["CaseSubResolution"]);
            }

            return(result);
        }