Beispiel #1
0
        /// <summary>
        /// Fullies the populate.
        /// </summary>
        /// <param name="mapping">The mapping.</param>
        /// <param name="dataReader">The data reader.</param>
        /// <param name="fullyPopulate">if set to <c>true</c> [fully populate].</param>
        private static void FullyPopulate(Mapping mapping, IDataReader dataReader, bool fullyPopulate)
        {
            if (fullyPopulate)
            {
                DataAccessProvider dataAccessProvider = DataAccessProvider.Instance();

                if (allSystems != null)
                {
                    mapping.SourceSystem =
                        allSystems.Find(
                            delegate(MappingSystem obj) { return(obj.Id == mapping.SourceSystemId && obj.IsSource); });

                    mapping.DestinationSystem =
                        allSystems.Find(
                            delegate(MappingSystem obj) { return(obj.Id == mapping.DestinationSystemId && obj.IsDestination); });
                }
                else
                {
                    mapping.SourceSystem = CBO <MappingSystem> .FillObject(dataAccessProvider.GetMappingSystem(mapping.SourceSystemId));

                    mapping.DestinationSystem = CBO <MappingSystem> .FillObject(dataAccessProvider.GetMappingSystem(mapping.DestinationSystemId));
                }


                if (allMappingPropertyAssociations != null)
                {
                    mapping.MappingPropertyAssociation =
                        allMappingPropertyAssociations.Find(delegate(MappingPropertyAssociation obj)
                    {
                        return(obj.Id == mapping.MappingPropertyAssociationId);
                    });
                }
                else
                {
                    mapping.MappingPropertyAssociation =
                        CBO <MappingPropertyAssociation> .FillObject(
                            dataAccessProvider.GetMappingPropertyAssociation(mapping.MappingPropertyAssociationId));
                }

                if (allClassAssociations != null)
                {
                    mapping.MappingPropertyAssociation.MappingClassAssociation =
                        allClassAssociations.Find(
                            delegate(MappingClassAssociation obj) { return(obj.Id == mapping.MappingPropertyAssociation.MappingClassAssociationId); });
                }
                else
                {
                    mapping.MappingPropertyAssociation.MappingClassAssociation = CBO <MappingClassAssociation> .FillObject(dataAccessProvider.GetMappingClassAssociation(mapping.MappingPropertyAssociation.MappingClassAssociationId));
                }
            }
        }