コード例 #1
0
        private IEnumerable <MySet> GetAllSets()
        {
            var mySets            = _setRepository.GetMySets();
            var myRebrickableSets = _referenceRepository.GetMySets();
            var domainSets        = new List <MySet>();

            foreach (var set in mySets)
            {
                var rebrickableSet = myRebrickableSets.FirstOrDefault(s => s.Set.SetNumber == set.SetNumber);

                var domainSet = new MySet();

                domainSet = Mapper.Map <MySet>(set);

                if (rebrickableSet != null)
                {
                    domainSet = Mapper.Map <MySet>(rebrickableSet);
                }

                domainSets.Add(domainSet);
            }

            return(domainSets);
        }