public override T ObjectConvert <T, U>(U entity)
        {
            CaseInsuranceMapping CaseInsuranceMappings = entity as CaseInsuranceMapping;

            if (CaseInsuranceMappings == null)
            {
                return(default(T));
            }

            BO.CaseInsuranceMapping CaseInsuranceMappingBO = new BO.CaseInsuranceMapping();
            CaseInsuranceMappingBO.ID     = CaseInsuranceMappings.Id;
            CaseInsuranceMappingBO.CaseId = CaseInsuranceMappings.CaseId;
            //CaseInsuranceMappingBO.PatientInsuranceInfos = new List<BO.PatientInsuranceInfo>();

            //using (PatientInsuranceInfoRepository sr = new PatientInsuranceInfoRepository(_context))
            //{
            //    CaseInsuranceMappingBO.PatientInsuranceInfos.Add(sr.Convert<BO.PatientInsuranceInfo, PatientInsuranceInfo>(CaseInsuranceMappings.PatientInsuranceInfo));
            //}

            BO.PatientInsuranceInfo patientInsuranceInfo = new BO.PatientInsuranceInfo();
            using (PatientInsuranceInfoRepository sr = new PatientInsuranceInfoRepository(_context))
            {
                patientInsuranceInfo = sr.Convert <BO.PatientInsuranceInfo, PatientInsuranceInfo>(CaseInsuranceMappings.PatientInsuranceInfo);
            }

            BO.AdjusterMaster adjusterMaster = new BO.AdjusterMaster();
            using (AdjusterMasterRepository sr = new AdjusterMasterRepository(_context))
            {
                adjusterMaster = sr.Convert <BO.AdjusterMaster, AdjusterMaster>(CaseInsuranceMappings.AdjusterMaster);
            }

            List <BO.Mapping> Mappings = new List <BO.Mapping>();

            Mappings.Add(new BO.Mapping()
            {
                Id = CaseInsuranceMappings.Id, PatientInsuranceInfo = patientInsuranceInfo, AdjusterMaster = adjusterMaster
            });
            CaseInsuranceMappingBO.Mappings = Mappings;

            return((T)(object)CaseInsuranceMappingBO);
        }
Example #2
0
 //[AllowAnonymous]
 public HttpResponseMessage Post([FromBody] CaseInsuranceMapping data)
 {
     return(requestHandler.CreateGbObject(Request, data));
 }