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 / StorageConditionPropertyMapping.cs / 1 / StorageConditionPropertyMapping.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....],[....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Data.Metadata.Edm; namespace System.Data.Mapping { ////// Mapping metadata for Conditional property mapping on a type. /// Condition Property Mapping specifies a Condition either on the C side property or S side property. /// ////// For Example if conceptually you could represent the CS MSL file as following /// --Mapping /// --EntityContainerMapping ( CNorthwind-->SNorthwind ) /// --EntitySetMapping /// --EntityTypeMapping /// --TableMappingFragment /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --EntityTypeMapping /// --TableMappingFragment /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ComplexPropertyMap /// --ComplexTypeMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarProperyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --AssociationSetMapping /// --AssociationTypeMapping /// --TableMappingFragment /// --EndPropertyMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarProperyMap ( CMemberMetadata-->SMemberMetadata ) /// --EndPropertyMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --EntityContainerMapping ( CMyDatabase-->SMyDatabase ) /// --CompositionSetMapping /// --CompositionTypeMapping /// --TableMappingFragment /// --ParentEntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionPropertyMap ( CMemberMetadata-->Constant value ) /// --ComplexPropertyMap /// --ComplexTypeMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->Constant value ) /// This class represents the metadata for all the condition property map elements in the /// above example. /// internal class StorageConditionPropertyMapping : StoragePropertyMapping { #region Constructors ////// Construct a new condition Property mapping object /// /// /// /// /// internal StorageConditionPropertyMapping(EdmProperty cdmMember, EdmProperty columnMember , object value, NullableisNull) : base(cdmMember) { Debug.Assert((cdmMember != null) || (columnMember != null), "Both CDM and Column Members can not be specified for Condition Mapping"); Debug.Assert((cdmMember == null) || (columnMember == null), "Either CDM or Column Members has to be specified for Condition Mapping"); Debug.Assert((isNull.HasValue) || (value != null), "Both Value and IsNull can not be specified on Condition Mapping"); Debug.Assert(!(isNull.HasValue) || (value == null), "Either Value or IsNull has to be specified on Condition Mapping"); this.m_columnMember = columnMember; this.m_value = value; this.m_isNull = isNull; } #endregion #region Fields EdmProperty m_columnMember; // Column EdmMember for which the condition is specified. object m_value; //value for the condition thats being mapped Nullable m_isNull; #endregion #region Properties /// /// Value for the condition /// internal object Value { get { return this.m_value; } } ////// Whether the property is being mapped to Null or NotNull /// internal NullableIsNull { get { return this.m_isNull; } } /// /// ColumnMember for which the Condition Map is being specified /// internal EdmProperty ColumnProperty { get { return this.m_columnMember; } } #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("ConditionPropertyMapping"); sb.Append(" "); if (this.EdmProperty != null) { sb.Append("Name:"); sb.Append(this.EdmProperty.Name); sb.Append(" "); } if (this.ColumnProperty != null) { sb.Append("Column Name:"); sb.Append(this.ColumnProperty.Name); sb.Append(" "); } if (this.Value != null) { sb.Append("Value:"); sb.Append("'" + Value + "'"); sb.Append(" "); sb.Append("Value CLR Type:"); sb.Append("'" + Value.GetType() + "'"); sb.Append(" "); } sb.Append("Value TypeMetadata:"); EdmType memberType = (ColumnProperty != null) ? ColumnProperty.TypeUsage.EdmType : null; if (memberType != null) { sb.Append("'" + memberType.FullName + "'"); sb.Append(" "); } if (this.IsNull.HasValue) { sb.Append("IsNull:"); sb.Append(this.IsNull); sb.Append(" "); } Console.WriteLine(sb.ToString()); } #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.Diagnostics; using System.Data.Metadata.Edm; namespace System.Data.Mapping { ////// Mapping metadata for Conditional property mapping on a type. /// Condition Property Mapping specifies a Condition either on the C side property or S side property. /// ////// For Example if conceptually you could represent the CS MSL file as following /// --Mapping /// --EntityContainerMapping ( CNorthwind-->SNorthwind ) /// --EntitySetMapping /// --EntityTypeMapping /// --TableMappingFragment /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --EntityTypeMapping /// --TableMappingFragment /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ComplexPropertyMap /// --ComplexTypeMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarProperyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --AssociationSetMapping /// --AssociationTypeMapping /// --TableMappingFragment /// --EndPropertyMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarProperyMap ( CMemberMetadata-->SMemberMetadata ) /// --EndPropertyMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --EntityContainerMapping ( CMyDatabase-->SMyDatabase ) /// --CompositionSetMapping /// --CompositionTypeMapping /// --TableMappingFragment /// --ParentEntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --EntityKey /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionPropertyMap ( CMemberMetadata-->Constant value ) /// --ComplexPropertyMap /// --ComplexTypeMap /// --ScalarPropertyMap ( CMemberMetadata-->SMemberMetadata ) /// --ConditionProperyMap ( constant value-->SMemberMetadata ) /// --ScalarPropertyMap ( CMemberMetadata-->Constant value ) /// This class represents the metadata for all the condition property map elements in the /// above example. /// internal class StorageConditionPropertyMapping : StoragePropertyMapping { #region Constructors ////// Construct a new condition Property mapping object /// /// /// /// /// internal StorageConditionPropertyMapping(EdmProperty cdmMember, EdmProperty columnMember , object value, NullableisNull) : base(cdmMember) { Debug.Assert((cdmMember != null) || (columnMember != null), "Both CDM and Column Members can not be specified for Condition Mapping"); Debug.Assert((cdmMember == null) || (columnMember == null), "Either CDM or Column Members has to be specified for Condition Mapping"); Debug.Assert((isNull.HasValue) || (value != null), "Both Value and IsNull can not be specified on Condition Mapping"); Debug.Assert(!(isNull.HasValue) || (value == null), "Either Value or IsNull has to be specified on Condition Mapping"); this.m_columnMember = columnMember; this.m_value = value; this.m_isNull = isNull; } #endregion #region Fields EdmProperty m_columnMember; // Column EdmMember for which the condition is specified. object m_value; //value for the condition thats being mapped Nullable m_isNull; #endregion #region Properties /// /// Value for the condition /// internal object Value { get { return this.m_value; } } ////// Whether the property is being mapped to Null or NotNull /// internal NullableIsNull { get { return this.m_isNull; } } /// /// ColumnMember for which the Condition Map is being specified /// internal EdmProperty ColumnProperty { get { return this.m_columnMember; } } #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("ConditionPropertyMapping"); sb.Append(" "); if (this.EdmProperty != null) { sb.Append("Name:"); sb.Append(this.EdmProperty.Name); sb.Append(" "); } if (this.ColumnProperty != null) { sb.Append("Column Name:"); sb.Append(this.ColumnProperty.Name); sb.Append(" "); } if (this.Value != null) { sb.Append("Value:"); sb.Append("'" + Value + "'"); sb.Append(" "); sb.Append("Value CLR Type:"); sb.Append("'" + Value.GetType() + "'"); sb.Append(" "); } sb.Append("Value TypeMetadata:"); EdmType memberType = (ColumnProperty != null) ? ColumnProperty.TypeUsage.EdmType : null; if (memberType != null) { sb.Append("'" + memberType.FullName + "'"); sb.Append(" "); } if (this.IsNull.HasValue) { sb.Append("IsNull:"); sb.Append(this.IsNull); sb.Append(" "); } Console.WriteLine(sb.ToString()); } #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
- COM2EnumConverter.cs
- XmlSchemaSimpleTypeUnion.cs
- XmlAttributeOverrides.cs
- SmtpMail.cs
- QilCloneVisitor.cs
- ScrollBarRenderer.cs
- CompareValidator.cs
- XmlSchemaAttributeGroupRef.cs
- Misc.cs
- exports.cs
- ScheduleChanges.cs
- DependencyProperty.cs
- Screen.cs
- FixedHyperLink.cs
- ChangeTracker.cs
- DataSourceHelper.cs
- WizardSideBarListControlItemEventArgs.cs
- PageTheme.cs
- ColorAnimationBase.cs
- SingleAnimation.cs
- ToolboxCategory.cs
- KeyGestureConverter.cs
- Menu.cs
- UnSafeCharBuffer.cs
- ObjectTypeMapping.cs
- TextSpanModifier.cs
- NegotiateStream.cs
- DataGridPagerStyle.cs
- HttpRuntime.cs
- DataGridViewDataConnection.cs
- ContentPlaceHolder.cs
- BaseCAMarshaler.cs
- PrintController.cs
- BidirectionalDictionary.cs
- OracleCommand.cs
- ListSourceHelper.cs
- MetadataArtifactLoaderFile.cs
- ArrangedElement.cs
- SafeRightsManagementQueryHandle.cs
- IIS7WorkerRequest.cs
- ActivityDesignerHighlighter.cs
- baseaxisquery.cs
- ListSourceHelper.cs
- DesignRelation.cs
- ToolStripProgressBar.cs
- PropertyGeneratedEventArgs.cs
- ObjectViewFactory.cs
- XmlPropertyBag.cs
- TraceUtility.cs
- WebServiceEnumData.cs
- AccessDataSource.cs
- ContainerParagraph.cs
- SqlDataSourceConfigureSortForm.cs
- AvTraceDetails.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- InputProviderSite.cs
- FeatureSupport.cs
- CounterSampleCalculator.cs
- ApplicationSettingsBase.cs
- ReflectPropertyDescriptor.cs
- DeclarativeCatalogPart.cs
- RequestTimeoutManager.cs
- SystemNetHelpers.cs
- LineGeometry.cs
- InstanceValue.cs
- CapiNative.cs
- KeySpline.cs
- DbCommandDefinition.cs
- LinearKeyFrames.cs
- BuildTopDownAttribute.cs
- CurrentChangedEventManager.cs
- GeneralTransform3D.cs
- ToolTipService.cs
- XmlSchemaImporter.cs
- HttpCacheVary.cs
- UmAlQuraCalendar.cs
- NamedPipeAppDomainProtocolHandler.cs
- ThrowHelper.cs
- ProxyWebPartConnectionCollection.cs
- TreeNodeBindingCollection.cs
- SQLInt64.cs
- SapiAttributeParser.cs
- ApplicationServiceHelper.cs
- XmlEntity.cs
- DebuggerAttributes.cs
- DataGridViewComponentPropertyGridSite.cs
- TextTreeRootNode.cs
- NotFiniteNumberException.cs
- _Win32.cs
- ManifestResourceInfo.cs
- ScrollEvent.cs
- WebBrowserContainer.cs
- EditingMode.cs
- ComplexTypeEmitter.cs
- DataColumnChangeEvent.cs
- FixedSOMTableCell.cs
- BamlLocalizer.cs
- SaveWorkflowCommand.cs
- AgileSafeNativeMemoryHandle.cs
- StateDesigner.Helpers.cs