Exemplo n.º 1
0
        public object ToBLO()
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile <GetResolvedCasesResultMapProfile>();
            });

            IMapper mapper = new Mapper(config);

            var blo = mapper.Map <EmpGetNextResolvedCaseNbrsRespBLO>(this);

            Fixer.TryFixInvalidWithGetCaseDetails(blo.CaseList);
            Fixer.RemoveInvalidFromCollection(blo.CaseList);

            //blo.CaseList = blo.CaseList.Where(x => Fixer.IsValid(x)).ToArray();
            blo.NumberOfCases = blo.CaseList.Count();

            if (this.CaseList.Count() > blo.CaseList.Count())
            {
                int    count = this.CaseList.Count() - blo.CaseList.Count();
                string msg   = string.Format("Mapping was missed for {0} cases; RawRespObject= ", count);
                Log_Error.AddError("Map<EmpGetNextResolvedCaseNbrsRespBLO>", "EVerifyService", msg + CustomTextMessageEncoder.LastResponceObjectRawString, true, false, "WP", string.Empty, "", "EVerify");
            }

            blo.DTO = this;
            return(blo);
        }