Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Mapping / StorageAssociationSetMapping.cs / 2 / StorageAssociationSetMapping.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Linq; using System.Data.Metadata.Edm; namespace System.Data.Mapping { ////// Represents the Mapping metadata for an AssociationSet in CS space. /// ////// For Example if conceptually you could represent the CS MSL file as following /// --Mapping /// --EntityContainerMapping ( CNorthwind-->SNorthwind ) /// --EntitySetMapping /// --EntityTypeMapping /// --TableMappingFragment /// --EntityTypeMapping /// --TableMappingFragment /// --AssociationSetMapping /// --AssociationTypeMapping /// --TableMappingFragment /// --EntityContainerMapping ( CMyDatabase-->SMyDatabase ) /// --CompositionSetMapping /// --CompositionTypeMapping /// This class represents the metadata for the AssociationSetMapping elements in the /// above example. And it is possible to access the AssociationTypeMap underneath it. /// There will be only one TypeMap under AssociationSetMap. /// internal class StorageAssociationSetMapping : StorageSetMapping { #region Constructors ////// Construct a new AssociationSetMapping object /// /// Represents the Association Set Metadata object. Will /// change this to Extent instead of MemberMetadata. /// The entityContainerMapping mapping that contains this Set mapping internal StorageAssociationSetMapping(AssociationSet extent, StorageEntityContainerMapping entityContainerMapping) : base(extent, entityContainerMapping) { } #endregion #region Fields private StorageAssociationSetFunctionMapping m_functionMapping; #endregion #region Properties ////////// The RealtionshipSet Metadata object for which the mapping is represented. ///// //internal AssociationSet AssociationSet { // get { // return this.Set as AssociationSet; // } //} ////// Gets or sets function mapping information for this association set. May be null. /// internal StorageAssociationSetFunctionMapping FunctionMapping { get { return m_functionMapping; } set { m_functionMapping = value; } } internal EntitySetBase StoreEntitySet { get { if ((this.TypeMappings.Count != 0) && (this.TypeMappings.First().MappingFragments.Count != 0)) { return this.TypeMappings.First().MappingFragments.First().TableSet; } return null; } } #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("AssociationSetMapping"); sb.Append(" "); sb.Append("Name:"); sb.Append(this.Set.Name); if (this.QueryView != null) { sb.Append(" "); sb.Append("Query View:"); sb.Append(this.QueryView); } Console.WriteLine(sb.ToString()); foreach (StorageTypeMapping typeMapping in TypeMappings) { typeMapping.Print(index + 5); } if(m_functionMapping != null) { m_functionMapping.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.Text; using System.Linq; using System.Data.Metadata.Edm; namespace System.Data.Mapping { ////// Represents the Mapping metadata for an AssociationSet in CS space. /// ////// For Example if conceptually you could represent the CS MSL file as following /// --Mapping /// --EntityContainerMapping ( CNorthwind-->SNorthwind ) /// --EntitySetMapping /// --EntityTypeMapping /// --TableMappingFragment /// --EntityTypeMapping /// --TableMappingFragment /// --AssociationSetMapping /// --AssociationTypeMapping /// --TableMappingFragment /// --EntityContainerMapping ( CMyDatabase-->SMyDatabase ) /// --CompositionSetMapping /// --CompositionTypeMapping /// This class represents the metadata for the AssociationSetMapping elements in the /// above example. And it is possible to access the AssociationTypeMap underneath it. /// There will be only one TypeMap under AssociationSetMap. /// internal class StorageAssociationSetMapping : StorageSetMapping { #region Constructors ////// Construct a new AssociationSetMapping object /// /// Represents the Association Set Metadata object. Will /// change this to Extent instead of MemberMetadata. /// The entityContainerMapping mapping that contains this Set mapping internal StorageAssociationSetMapping(AssociationSet extent, StorageEntityContainerMapping entityContainerMapping) : base(extent, entityContainerMapping) { } #endregion #region Fields private StorageAssociationSetFunctionMapping m_functionMapping; #endregion #region Properties ////////// The RealtionshipSet Metadata object for which the mapping is represented. ///// //internal AssociationSet AssociationSet { // get { // return this.Set as AssociationSet; // } //} ////// Gets or sets function mapping information for this association set. May be null. /// internal StorageAssociationSetFunctionMapping FunctionMapping { get { return m_functionMapping; } set { m_functionMapping = value; } } internal EntitySetBase StoreEntitySet { get { if ((this.TypeMappings.Count != 0) && (this.TypeMappings.First().MappingFragments.Count != 0)) { return this.TypeMappings.First().MappingFragments.First().TableSet; } return null; } } #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("AssociationSetMapping"); sb.Append(" "); sb.Append("Name:"); sb.Append(this.Set.Name); if (this.QueryView != null) { sb.Append(" "); sb.Append("Query View:"); sb.Append(this.QueryView); } Console.WriteLine(sb.ToString()); foreach (StorageTypeMapping typeMapping in TypeMappings) { typeMapping.Print(index + 5); } if(m_functionMapping != null) { m_functionMapping.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
- TableCell.cs
- Instrumentation.cs
- HtmlTextArea.cs
- DoubleAnimationClockResource.cs
- CompilerCollection.cs
- DataGridViewCellPaintingEventArgs.cs
- DeviceFiltersSection.cs
- FileDialog.cs
- DataShape.cs
- IdSpace.cs
- BuildProvidersCompiler.cs
- XmlWhitespace.cs
- CheckBoxList.cs
- ListViewGroupItemCollection.cs
- FloatSumAggregationOperator.cs
- VScrollBar.cs
- HtmlTextArea.cs
- ISessionStateStore.cs
- AsymmetricKeyExchangeFormatter.cs
- WebDisplayNameAttribute.cs
- PreservationFileWriter.cs
- DrawingVisualDrawingContext.cs
- ObjectParameterCollection.cs
- ValidationErrorCollection.cs
- Imaging.cs
- SqlFormatter.cs
- InkCanvas.cs
- AcceleratedTokenProviderState.cs
- WebPartCollection.cs
- AppDomainManager.cs
- XMLSyntaxException.cs
- BufferBuilder.cs
- _NestedMultipleAsyncResult.cs
- LogicalTreeHelper.cs
- EditingCoordinator.cs
- ObjRef.cs
- _SecureChannel.cs
- MessageQueuePermissionEntry.cs
- SessionIDManager.cs
- CellRelation.cs
- RTTrackingProfile.cs
- ComponentEvent.cs
- XmlWrappingWriter.cs
- ImageMapEventArgs.cs
- CookielessHelper.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ImplicitInputBrush.cs
- CollectionViewGroupRoot.cs
- followingsibling.cs
- SiteMapPath.cs
- Qualifier.cs
- XmlRootAttribute.cs
- XPathNavigatorReader.cs
- HtmlTableRowCollection.cs
- altserialization.cs
- DiagnosticSection.cs
- COM2ComponentEditor.cs
- DataGridViewCheckBoxCell.cs
- BuiltInExpr.cs
- StructuredTypeInfo.cs
- ServiceErrorHandler.cs
- EventProviderTraceListener.cs
- XmlSchemaRedefine.cs
- StreamMarshaler.cs
- HttpApplicationStateWrapper.cs
- QueryOutputWriter.cs
- XPathBuilder.cs
- SqlException.cs
- DecoderBestFitFallback.cs
- XPathMessageFilterElementCollection.cs
- StyleHelper.cs
- TypeNameConverter.cs
- OdbcException.cs
- CompoundFileStreamReference.cs
- UpWmlMobileTextWriter.cs
- RectangleGeometry.cs
- BoundingRectTracker.cs
- XmlMembersMapping.cs
- ManipulationStartedEventArgs.cs
- XamlDesignerSerializationManager.cs
- BoundsDrawingContextWalker.cs
- PackagingUtilities.cs
- ImageCollectionCodeDomSerializer.cs
- EditorZoneDesigner.cs
- CallbackValidatorAttribute.cs
- QueueProcessor.cs
- RuntimeComponentFilter.cs
- SvcMapFileLoader.cs
- WebPartUserCapability.cs
- CachedFontFace.cs
- ClientTargetCollection.cs
- ClientBuildManager.cs
- RuntimeEnvironment.cs
- METAHEADER.cs
- RadioButtonBaseAdapter.cs
- HeaderCollection.cs
- HttpCacheVaryByContentEncodings.cs
- DirectoryRedirect.cs
- XmlSchemaDatatype.cs
- CompilerInfo.cs