Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Mapping / StorageAssociationSetMapping.cs / 1 / 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
- DotNetATv1WindowsLogEntryDeserializer.cs
- TempFiles.cs
- DataObject.cs
- _BasicClient.cs
- EntityDesignerDataSourceView.cs
- DrawingDrawingContext.cs
- EditorPartDesigner.cs
- PtsHost.cs
- CodeDirectiveCollection.cs
- AtomParser.cs
- NonSerializedAttribute.cs
- ProjectedSlot.cs
- RepeaterItem.cs
- XmlDataLoader.cs
- XmlSubtreeReader.cs
- EastAsianLunisolarCalendar.cs
- SuppressIldasmAttribute.cs
- WebPartZoneCollection.cs
- TextBoxBase.cs
- ExpressionNode.cs
- BoundPropertyEntry.cs
- EntityViewGenerator.cs
- AttachmentCollection.cs
- DesignerDataConnection.cs
- WCFServiceClientProxyGenerator.cs
- ConvertEvent.cs
- Mouse.cs
- ReaderWriterLockSlim.cs
- FlowDecision.cs
- ConstrainedDataObject.cs
- ProfileSettings.cs
- BulletChrome.cs
- PassportAuthentication.cs
- WinCategoryAttribute.cs
- PipeSecurity.cs
- DocumentViewerHelper.cs
- SrgsElementList.cs
- _NegotiateClient.cs
- SafeNativeMethodsMilCoreApi.cs
- ListItemConverter.cs
- RepeatButton.cs
- DataSourceIDConverter.cs
- PeerEndPoint.cs
- RegexRunnerFactory.cs
- XmlAttributeOverrides.cs
- cookie.cs
- InternalRelationshipCollection.cs
- InkCanvasInnerCanvas.cs
- MergeFilterQuery.cs
- GeometryGroup.cs
- CommandHelper.cs
- WindowsToolbarAsMenu.cs
- ListViewSelectEventArgs.cs
- LinqDataSourceContextData.cs
- XmlILIndex.cs
- ISO2022Encoding.cs
- ObjectListShowCommandsEventArgs.cs
- XmlEncodedRawTextWriter.cs
- CodeMemberField.cs
- UnlockInstanceAsyncResult.cs
- MessageDecoder.cs
- EncryptedPackage.cs
- ContentPlaceHolder.cs
- SoapSchemaMember.cs
- DiffuseMaterial.cs
- DirtyTextRange.cs
- SortDescription.cs
- HtmlEncodedRawTextWriter.cs
- ReservationCollection.cs
- HtmlUtf8RawTextWriter.cs
- MessageDecoder.cs
- ProcessStartInfo.cs
- StubHelpers.cs
- CodeValidator.cs
- DictionaryKeyPropertyAttribute.cs
- HtmlContainerControl.cs
- DurableEnlistmentState.cs
- GridViewColumnHeader.cs
- XmlReader.cs
- SymLanguageType.cs
- SolidColorBrush.cs
- ReadOnlyTernaryTree.cs
- CodeTryCatchFinallyStatement.cs
- GenericPrincipal.cs
- SecurityUtils.cs
- CacheModeConverter.cs
- SqlInternalConnectionSmi.cs
- FunctionImportMapping.cs
- SoapDocumentMethodAttribute.cs
- ExpandCollapsePattern.cs
- InputLanguageCollection.cs
- ItemCollection.cs
- TextLine.cs
- HandleCollector.cs
- Size3D.cs
- AsymmetricAlgorithm.cs
- UnionQueryOperator.cs
- Point3DConverter.cs
- StructuredCompositeActivityDesigner.cs
- ILGenerator.cs