Exemplo n.º 1
0
        public void SaveDestinationMappingClassAssociationConstraint()
        {
            using (TransactionScope scope = new TransactionScope())
            {
                MappingController.DeleteAllMappings();
                MappingController.DeleteAllMappingSystems();
                MappingController.DeleteAllMappingPropertyAssociations();
                MappingController.DeleteAllMappingClassAssociations();

                MappingClassAssociation classAssociation = PopulateNewMappingClassAssocation();

                MappingController.SaveMappingClassAssociation(classAssociation);
                MappingController.SaveMappingClassAssociation(classAssociation);
            }
        }
Exemplo n.º 2
0
        private MappingPropertyAssociation PopulateNewMappingPropertyAssocation()
        {
            MappingPropertyAssociation propertyAssociation = new MappingPropertyAssociation();

            //setup the class association which defines the source and destination types the source and destination properties will belong to
            propertyAssociation.MappingClassAssociation    = PopulateNewMappingClassAssocation();
            propertyAssociation.MappingClassAssociation.Id = MappingController.SaveMappingClassAssociation(propertyAssociation.MappingClassAssociation);
            propertyAssociation.MappingClassAssociationId  = propertyAssociation.MappingClassAssociation.Id;

            propertyAssociation.DestinationProperty      = "RouteCode";
            propertyAssociation.SourceProperty           = "RouteCode";
            propertyAssociation.LookupTableName          = "Discovery_Route";
            propertyAssociation.LookUpTableDisplayColumn = "Description";

            return(propertyAssociation);
        }
Exemplo n.º 3
0
 public void SaveDestinationMappingClassAssociation()
 {
     using (TransactionScope scope = new TransactionScope())
     {
         if (MappingController.DeleteAllMappings())
         {
             if (MappingController.DeleteAllMappingSystems())
             {
                 if (MappingController.DeleteAllMappingPropertyAssociations())
                 {
                     if (MappingController.DeleteAllMappingClassAssociations())
                     {
                         Assert.IsTrue(MappingController.SaveMappingClassAssociation(PopulateNewMappingClassAssocation()) != -1);
                     }
                 }
             }
         }
     }
 }