Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Mapping / StorageAssociationTypeMapping.cs / 1305376 / StorageAssociationTypeMapping.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Data.Metadata.Edm;
namespace System.Data.Mapping {
///
/// Represents the Mapping metadata for an association type map in CS space.
///
///
/// For Example if conceptually you could represent the CS MSL file as following
/// --Mapping
/// --EntityContainerMapping ( CNorthwind-->SNorthwind )
/// --EntitySetMapping
/// --EntityTypeMapping
/// --TableMappingFragment
/// --EntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --EntityTypeMapping
/// --TableMappingFragment
/// --EntityKey
/// --ScalarPropertyMap
/// --ComplexPropertyMap
/// --ComplexTypeMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --ScalarPropertyMap
/// --AssociationSetMapping
/// --AssociationTypeMapping
/// --TableMappingFragment
/// --EndPropertyMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --EndPropertyMap
/// --ScalarPropertyMap
/// --EntityContainerMapping ( CMyDatabase-->SMyDatabase )
/// --CompositionSetMapping
/// --CompositionTypeMapping
/// --TableMappingFragment
/// --ParentEntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --EntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --ComplexPropertyMap
/// --ComplexTypeMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --ScalarPropertyMap
/// This class represents the metadata for all association Type map elements in the
/// above example. Users can access the table mapping fragments under the
/// association type mapping through this class.
///
internal class StorageAssociationTypeMapping : StorageTypeMapping {
#region Constructors
///
/// Construct the new AssociationTypeMapping object.
///
/// Represents the Association Type metadata object
/// Set Mapping that contains this Type mapping
internal StorageAssociationTypeMapping(AssociationType relation, StorageSetMapping setMapping)
: base(setMapping) {
this.m_relation = relation;
}
#endregion
#region Fields
AssociationType m_relation; //Type for which the mapping is represented
#endregion
#region Properties
///
/// The AssociationTypeType Metadata object for which the mapping is represented.
///
internal AssociationType AssociationType
{
get {
return this.m_relation;
}
}
///
/// a list of TypeMetadata that this mapping holds true for.
/// Since Association types dont participate in Inheritance, This can only
/// be one type.
///
internal override ReadOnlyCollection Types {
get {
return new ReadOnlyCollection(new AssociationType[] { m_relation });
}
}
///
/// a list of TypeMetadatas for which the mapping holds true for
/// not only the type specified but the sub-types of that type as well.
/// Since Association types dont participate in Inheritance, an Empty list
/// is returned here.
///
internal override ReadOnlyCollection IsOfTypes {
get {
return new List().AsReadOnly();
}
}
#endregion
#region Methods
///
/// This method is primarily for debugging purposes.
/// Will be removed shortly.
///
///
internal override void Print(int index) {
StorageEntityContainerMapping.GetPrettyPrintString(ref index);
StringBuilder sb = new StringBuilder();
sb.Append("AssociationTypeMapping");
sb.Append(" ");
sb.Append("Type Name:");
sb.Append(this.m_relation.Name);
sb.Append(" ");
Console.WriteLine(sb.ToString());
foreach (StorageMappingFragment fragment in MappingFragments) {
fragment.Print(index + 5);
}
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Data.Metadata.Edm;
namespace System.Data.Mapping {
///
/// Represents the Mapping metadata for an association type map in CS space.
///
///
/// For Example if conceptually you could represent the CS MSL file as following
/// --Mapping
/// --EntityContainerMapping ( CNorthwind-->SNorthwind )
/// --EntitySetMapping
/// --EntityTypeMapping
/// --TableMappingFragment
/// --EntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --EntityTypeMapping
/// --TableMappingFragment
/// --EntityKey
/// --ScalarPropertyMap
/// --ComplexPropertyMap
/// --ComplexTypeMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --ScalarPropertyMap
/// --AssociationSetMapping
/// --AssociationTypeMapping
/// --TableMappingFragment
/// --EndPropertyMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --EndPropertyMap
/// --ScalarPropertyMap
/// --EntityContainerMapping ( CMyDatabase-->SMyDatabase )
/// --CompositionSetMapping
/// --CompositionTypeMapping
/// --TableMappingFragment
/// --ParentEntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --EntityKey
/// --ScalarPropertyMap
/// --ScalarPropertyMap
/// --ComplexPropertyMap
/// --ComplexTypeMap
/// --ScalarPropertyMap
/// --ScalarProperyMap
/// --ScalarPropertyMap
/// This class represents the metadata for all association Type map elements in the
/// above example. Users can access the table mapping fragments under the
/// association type mapping through this class.
///
internal class StorageAssociationTypeMapping : StorageTypeMapping {
#region Constructors
///
/// Construct the new AssociationTypeMapping object.
///
/// Represents the Association Type metadata object
/// Set Mapping that contains this Type mapping
internal StorageAssociationTypeMapping(AssociationType relation, StorageSetMapping setMapping)
: base(setMapping) {
this.m_relation = relation;
}
#endregion
#region Fields
AssociationType m_relation; //Type for which the mapping is represented
#endregion
#region Properties
///
/// The AssociationTypeType Metadata object for which the mapping is represented.
///
internal AssociationType AssociationType
{
get {
return this.m_relation;
}
}
///
/// a list of TypeMetadata that this mapping holds true for.
/// Since Association types dont participate in Inheritance, This can only
/// be one type.
///
internal override ReadOnlyCollection Types {
get {
return new ReadOnlyCollection(new AssociationType[] { m_relation });
}
}
///
/// a list of TypeMetadatas for which the mapping holds true for
/// not only the type specified but the sub-types of that type as well.
/// Since Association types dont participate in Inheritance, an Empty list
/// is returned here.
///
internal override ReadOnlyCollection IsOfTypes {
get {
return new List().AsReadOnly();
}
}
#endregion
#region Methods
///
/// This method is primarily for debugging purposes.
/// Will be removed shortly.
///
///
internal override void Print(int index) {
StorageEntityContainerMapping.GetPrettyPrintString(ref index);
StringBuilder sb = new StringBuilder();
sb.Append("AssociationTypeMapping");
sb.Append(" ");
sb.Append("Type Name:");
sb.Append(this.m_relation.Name);
sb.Append(" ");
Console.WriteLine(sb.ToString());
foreach (StorageMappingFragment fragment in MappingFragments) {
fragment.Print(index + 5);
}
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RuntimeIdentifierPropertyAttribute.cs
- GridViewItemAutomationPeer.cs
- X509Utils.cs
- ThreadStateException.cs
- MasterPageBuildProvider.cs
- PointCollection.cs
- unsafeIndexingFilterStream.cs
- FlowchartStart.xaml.cs
- externdll.cs
- Point3DCollectionConverter.cs
- TemplateBindingExtensionConverter.cs
- TypeValidationEventArgs.cs
- Pen.cs
- CornerRadiusConverter.cs
- DoubleCollection.cs
- base64Transforms.cs
- Section.cs
- WebPartTransformerCollection.cs
- FunctionImportMapping.cs
- Error.cs
- ConfigDefinitionUpdates.cs
- ResourceReader.cs
- AdapterDictionary.cs
- ProfileSettingsCollection.cs
- ClusterRegistryConfigurationProvider.cs
- FontConverter.cs
- Constraint.cs
- MatrixAnimationUsingKeyFrames.cs
- QilBinary.cs
- DbMetaDataCollectionNames.cs
- Globals.cs
- TemplateBindingExtensionConverter.cs
- RadioButtonStandardAdapter.cs
- Console.cs
- HwndKeyboardInputProvider.cs
- PasswordBox.cs
- NeutralResourcesLanguageAttribute.cs
- FileRecordSequence.cs
- _LoggingObject.cs
- LogWriteRestartAreaAsyncResult.cs
- _KerberosClient.cs
- XmlSchemaAnnotation.cs
- MarshalDirectiveException.cs
- SqlLiftWhereClauses.cs
- DataBoundControlDesigner.cs
- StylusSystemGestureEventArgs.cs
- RedirectionProxy.cs
- BooleanAnimationUsingKeyFrames.cs
- XmlExtensionFunction.cs
- HttpListenerRequestTraceRecord.cs
- ScriptMethodAttribute.cs
- FileDialog.cs
- StreamWriter.cs
- ExpressionBuilder.cs
- DataControlFieldCell.cs
- SmiEventSink.cs
- ListCollectionView.cs
- odbcmetadatacollectionnames.cs
- CompiledXpathExpr.cs
- XPathPatternBuilder.cs
- StatusBarPanelClickEvent.cs
- ServiceOperation.cs
- Quad.cs
- NativeMethods.cs
- XmlSchemaSimpleContentExtension.cs
- TypeUnloadedException.cs
- ManagedWndProcTracker.cs
- ScriptBehaviorDescriptor.cs
- LocalServiceSecuritySettingsElement.cs
- DataSourceProvider.cs
- MenuBase.cs
- HttpClientCertificate.cs
- XmlILOptimizerVisitor.cs
- X509CertificateCollection.cs
- DataGridParentRows.cs
- TraversalRequest.cs
- AspCompat.cs
- StrokeIntersection.cs
- SetIndexBinder.cs
- XmlCharCheckingWriter.cs
- WindowsListViewItem.cs
- Memoizer.cs
- SqlConnectionPoolProviderInfo.cs
- _SpnDictionary.cs
- ToolboxComponentsCreatingEventArgs.cs
- EngineSite.cs
- CompilationLock.cs
- SqlErrorCollection.cs
- DataGridRowAutomationPeer.cs
- ActiveDocumentEvent.cs
- DataServices.cs
- securitycriticaldataClass.cs
- FixedSOMImage.cs
- SiteMap.cs
- ParameterCollection.cs
- DataControlFieldCell.cs
- ConstructorNeedsTagAttribute.cs
- EdmValidator.cs
- ItemCheckEvent.cs
- SafeMILHandle.cs