public static ISqlModelElementReference AdaptInstance()

in DacFxStronglyTypedModel/model.cs [41:300]


	    public static ISqlModelElementReference AdaptInstance(ModelRelationshipInstance obj, Func<ModelRelationshipInstance,ISqlModelElementReference> createUnresolvedElement)
        {
            ModelTypeClass objectType = null;
		
            if(obj == null)
		    {
			    throw new ArgumentNullException("obj");
		    }	

            if (obj.Object != null)
            {
                objectType = obj.Object.ObjectType;
            }
            else
            {
                return createUnresolvedElement(obj);
            }
		
		    switch(objectType.Name)
		    {
		    case "Column":     
                return new TSqlColumnReference(obj, objectType);
		    case "TableValuedFunction":     
                return new TSqlTableValuedFunctionReference(obj, objectType);
		    case "ScalarFunction":     
                return new TSqlScalarFunctionReference(obj, objectType);
		    case "ClrTableOption":     
                return new TSqlClrTableOptionReference(obj, objectType);
		    case "Aggregate":     
                return new TSqlAggregateReference(obj, objectType);
		    case "ApplicationRole":     
                return new TSqlApplicationRoleReference(obj, objectType);
		    case "Index":     
                return new TSqlIndexReference(obj, objectType);
		    case "Assembly":     
                return new TSqlAssemblyReference(obj, objectType);
		    case "AssemblySource":     
                return new TSqlAssemblySourceReference(obj, objectType);
		    case "AsymmetricKey":     
                return new TSqlAsymmetricKeyReference(obj, objectType);
		    case "AuditAction":     
                return new TSqlAuditActionReference(obj, objectType);
		    case "AuditActionGroup":     
                return new TSqlAuditActionGroupReference(obj, objectType);
		    case "AuditActionSpecification":     
                return new TSqlAuditActionSpecificationReference(obj, objectType);
		    case "BrokerPriority":     
                return new TSqlBrokerPriorityReference(obj, objectType);
		    case "BuiltInServerRole":     
                return new TSqlBuiltInServerRoleReference(obj, objectType);
		    case "DataType":     
                return new TSqlDataTypeReference(obj, objectType);
		    case "Certificate":     
                return new TSqlCertificateReference(obj, objectType);
		    case "CheckConstraint":     
                return new TSqlCheckConstraintReference(obj, objectType);
		    case "ClrTypeMethod":     
                return new TSqlClrTypeMethodReference(obj, objectType);
		    case "ClrTypeMethodParameter":     
                return new TSqlClrTypeMethodParameterReference(obj, objectType);
		    case "ClrTypeProperty":     
                return new TSqlClrTypePropertyReference(obj, objectType);
		    case "ColumnStoreIndex":     
                return new TSqlColumnStoreIndexReference(obj, objectType);
		    case "Contract":     
                return new TSqlContractReference(obj, objectType);
		    case "Credential":     
                return new TSqlCredentialReference(obj, objectType);
		    case "CryptographicProvider":     
                return new TSqlCryptographicProviderReference(obj, objectType);
		    case "DatabaseAuditSpecification":     
                return new TSqlDatabaseAuditSpecificationReference(obj, objectType);
		    case "DatabaseDdlTrigger":     
                return new TSqlDatabaseDdlTriggerReference(obj, objectType);
		    case "DatabaseEncryptionKey":     
                return new TSqlDatabaseEncryptionKeyReference(obj, objectType);
		    case "DatabaseEventNotification":     
                return new TSqlDatabaseEventNotificationReference(obj, objectType);
		    case "DatabaseMirroringLanguageSpecifier":     
                return new TSqlDatabaseMirroringLanguageSpecifierReference(obj, objectType);
		    case "DatabaseOptions":     
                return new TSqlDatabaseOptionsReference(obj, objectType);
		    case "DataCompressionOption":     
                return new TSqlDataCompressionOptionReference(obj, objectType);
		    case "Default":     
                return new TSqlDefaultReference(obj, objectType);
		    case "DefaultConstraint":     
                return new TSqlDefaultConstraintReference(obj, objectType);
		    case "DmlTrigger":     
                return new TSqlDmlTriggerReference(obj, objectType);
		    case "Endpoint":     
                return new TSqlEndpointReference(obj, objectType);
		    case "ErrorMessage":     
                return new TSqlErrorMessageReference(obj, objectType);
		    case "EventGroup":     
                return new TSqlEventGroupReference(obj, objectType);
		    case "EventSession":     
                return new TSqlEventSessionReference(obj, objectType);
		    case "EventSessionAction":     
                return new TSqlEventSessionActionReference(obj, objectType);
		    case "EventSessionDefinitions":     
                return new TSqlEventSessionDefinitionsReference(obj, objectType);
		    case "EventSessionSetting":     
                return new TSqlEventSessionSettingReference(obj, objectType);
		    case "EventSessionTarget":     
                return new TSqlEventSessionTargetReference(obj, objectType);
		    case "EventTypeSpecifier":     
                return new TSqlEventTypeSpecifierReference(obj, objectType);
		    case "ExtendedProcedure":     
                return new TSqlExtendedProcedureReference(obj, objectType);
		    case "ExtendedProperty":     
                return new TSqlExtendedPropertyReference(obj, objectType);
		    case "SqlFile":     
                return new TSqlSqlFileReference(obj, objectType);
		    case "Filegroup":     
                return new TSqlFilegroupReference(obj, objectType);
		    case "ForeignKeyConstraint":     
                return new TSqlForeignKeyConstraintReference(obj, objectType);
		    case "FullTextCatalog":     
                return new TSqlFullTextCatalogReference(obj, objectType);
		    case "FullTextIndex":     
                return new TSqlFullTextIndexReference(obj, objectType);
		    case "FullTextIndexColumnSpecifier":     
                return new TSqlFullTextIndexColumnSpecifierReference(obj, objectType);
		    case "FullTextStopList":     
                return new TSqlFullTextStopListReference(obj, objectType);
		    case "HttpProtocolSpecifier":     
                return new TSqlHttpProtocolSpecifierReference(obj, objectType);
		    case "LinkedServer":     
                return new TSqlLinkedServerReference(obj, objectType);
		    case "LinkedServerLogin":     
                return new TSqlLinkedServerLoginReference(obj, objectType);
		    case "Login":     
                return new TSqlLoginReference(obj, objectType);
		    case "MasterKey":     
                return new TSqlMasterKeyReference(obj, objectType);
		    case "MessageType":     
                return new TSqlMessageTypeReference(obj, objectType);
		    case "PartitionFunction":     
                return new TSqlPartitionFunctionReference(obj, objectType);
		    case "PartitionScheme":     
                return new TSqlPartitionSchemeReference(obj, objectType);
		    case "PartitionValue":     
                return new TSqlPartitionValueReference(obj, objectType);
		    case "Permission":     
                return new TSqlPermissionReference(obj, objectType);
		    case "PrimaryKeyConstraint":     
                return new TSqlPrimaryKeyConstraintReference(obj, objectType);
		    case "Procedure":     
                return new TSqlProcedureReference(obj, objectType);
		    case "Queue":     
                return new TSqlQueueReference(obj, objectType);
		    case "QueueEventNotification":     
                return new TSqlQueueEventNotificationReference(obj, objectType);
		    case "RemoteServiceBinding":     
                return new TSqlRemoteServiceBindingReference(obj, objectType);
		    case "ResourceGovernor":     
                return new TSqlResourceGovernorReference(obj, objectType);
		    case "ResourcePool":     
                return new TSqlResourcePoolReference(obj, objectType);
		    case "Role":     
                return new TSqlRoleReference(obj, objectType);
		    case "RoleMembership":     
                return new TSqlRoleMembershipReference(obj, objectType);
		    case "Route":     
                return new TSqlRouteReference(obj, objectType);
		    case "Rule":     
                return new TSqlRuleReference(obj, objectType);
		    case "Schema":     
                return new TSqlSchemaReference(obj, objectType);
		    case "SearchProperty":     
                return new TSqlSearchPropertyReference(obj, objectType);
		    case "SearchPropertyList":     
                return new TSqlSearchPropertyListReference(obj, objectType);
		    case "Sequence":     
                return new TSqlSequenceReference(obj, objectType);
		    case "ServerAudit":     
                return new TSqlServerAuditReference(obj, objectType);
		    case "ServerAuditSpecification":     
                return new TSqlServerAuditSpecificationReference(obj, objectType);
		    case "ServerDdlTrigger":     
                return new TSqlServerDdlTriggerReference(obj, objectType);
		    case "ServerEventNotification":     
                return new TSqlServerEventNotificationReference(obj, objectType);
		    case "ServerOptions":     
                return new TSqlServerOptionsReference(obj, objectType);
		    case "ServerRoleMembership":     
                return new TSqlServerRoleMembershipReference(obj, objectType);
		    case "Service":     
                return new TSqlServiceReference(obj, objectType);
		    case "ServiceBrokerLanguageSpecifier":     
                return new TSqlServiceBrokerLanguageSpecifierReference(obj, objectType);
		    case "Signature":     
                return new TSqlSignatureReference(obj, objectType);
		    case "SignatureEncryptionMechanism":     
                return new TSqlSignatureEncryptionMechanismReference(obj, objectType);
		    case "SoapLanguageSpecifier":     
                return new TSqlSoapLanguageSpecifierReference(obj, objectType);
		    case "SoapMethodSpecification":     
                return new TSqlSoapMethodSpecificationReference(obj, objectType);
		    case "SpatialIndex":     
                return new TSqlSpatialIndexReference(obj, objectType);
		    case "Statistics":     
                return new TSqlStatisticsReference(obj, objectType);
		    case "Parameter":     
                return new TSqlParameterReference(obj, objectType);
		    case "SymmetricKey":     
                return new TSqlSymmetricKeyReference(obj, objectType);
		    case "SymmetricKeyPassword":     
                return new TSqlSymmetricKeyPasswordReference(obj, objectType);
		    case "Synonym":     
                return new TSqlSynonymReference(obj, objectType);
		    case "Table":     
                return new TSqlTableReference(obj, objectType);
		    case "FileTable":     
                return new TSqlFileTableReference(obj, objectType);
		    case "TableType":     
                return new TSqlTableTypeReference(obj, objectType);
		    case "TableTypeCheckConstraint":     
                return new TSqlTableTypeCheckConstraintReference(obj, objectType);
		    case "TableTypeColumn":     
                return new TSqlTableTypeColumnReference(obj, objectType);
		    case "TableTypeDefaultConstraint":     
                return new TSqlTableTypeDefaultConstraintReference(obj, objectType);
		    case "TableTypeIndex":     
                return new TSqlTableTypeIndexReference(obj, objectType);
		    case "TableTypePrimaryKeyConstraint":     
                return new TSqlTableTypePrimaryKeyConstraintReference(obj, objectType);
		    case "TableTypeUniqueConstraint":     
                return new TSqlTableTypeUniqueConstraintReference(obj, objectType);
		    case "TcpProtocolSpecifier":     
                return new TSqlTcpProtocolSpecifierReference(obj, objectType);
		    case "UniqueConstraint":     
                return new TSqlUniqueConstraintReference(obj, objectType);
		    case "User":     
                return new TSqlUserReference(obj, objectType);
		    case "UserDefinedServerRole":     
                return new TSqlUserDefinedServerRoleReference(obj, objectType);
		    case "UserDefinedType":     
                return new TSqlUserDefinedTypeReference(obj, objectType);
		    case "View":     
                return new TSqlViewReference(obj, objectType);
		    case "WorkloadGroup":     
                return new TSqlWorkloadGroupReference(obj, objectType);
		    case "XmlIndex":     
                return new TSqlXmlIndexReference(obj, objectType);
		    case "SelectiveXmlIndex":     
                return new TSqlSelectiveXmlIndexReference(obj, objectType);
		    case "XmlNamespace":     
                return new TSqlXmlNamespaceReference(obj, objectType);
		    case "PromotedNodePathForXQueryType":     
                return new TSqlPromotedNodePathForXQueryTypeReference(obj, objectType);
		    case "PromotedNodePathForSqlType":     
                return new TSqlPromotedNodePathForSqlTypeReference(obj, objectType);
		    case "XmlSchemaCollection":     
                return new TSqlXmlSchemaCollectionReference(obj, objectType);
		    default:
			    throw new ArgumentException("No type mapping exists for " + objectType.Name);
		    }
	    }