Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / NavigationPropertySingletonExpression.cs / 1305376 / NavigationPropertySingletonExpression.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Respresents a navigation to a singleton property. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { #region Private fields. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; #endregion Private fields. ///Expression for a navigation property into a single entity (eg: Customer.BestFriend). internal class NavigationPropertySingletonExpression : ResourceExpression { #region Private fields. ///property member name private readonly Expression memberExpression; ///resource type private readonly Type resourceType; #endregion Private fields. ////// Creates a NavigationPropertySingletonExpression expression /// /// the return type of the expression /// the source expression /// property member name /// resource type for expression /// expand paths for resource set /// count option for the resource set /// custom query options for resourcse set /// projection expression internal NavigationPropertySingletonExpression(Type type, Expression source, Expression memberExpression, Type resourceType, ListexpandPaths, CountOption countOption, Dictionary customQueryOptions, ProjectionQueryOptionExpression projection) : base(source, (ExpressionType)ResourceExpressionType.ResourceNavigationPropertySingleton, type, expandPaths, countOption, customQueryOptions, projection) { Debug.Assert(memberExpression != null, "memberExpression != null"); Debug.Assert(resourceType != null, "resourceType != null"); this.memberExpression = memberExpression; this.resourceType = resourceType; } /// /// Gets the member expression. /// internal MemberExpression MemberExpression { get { return (MemberExpression)this.memberExpression; } } ////// The resource type of the singe instance produced by this singleton navigation. /// internal override Type ResourceType { get { return this.resourceType; } } ////// Singleton navigation properties always produce at most 1 result /// internal override bool IsSingleton { get { return true; } } ////// Does Singleton navigation have query options. /// internal override bool HasQueryOptions { get { return this.ExpandPaths.Count > 0 || this.CountOption == CountOption.InlineAll || this.CustomQueryOptions.Count > 0 || this.Projection != null; } } ////// Cast changes the type of the ResourceExpression /// /// new type ///new NavigationPropertySingletonExpression internal override ResourceExpression CreateCloneWithNewType(Type type) { return new NavigationPropertySingletonExpression( type, this.source, this.MemberExpression, TypeSystem.GetElementType(type), this.ExpandPaths.ToList(), this.CountOption, this.CustomQueryOptions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value), this.Projection); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Respresents a navigation to a singleton property. // // // @owner [....] //--------------------------------------------------------------------- namespace System.Data.Services.Client { #region Private fields. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; #endregion Private fields. ///Expression for a navigation property into a single entity (eg: Customer.BestFriend). internal class NavigationPropertySingletonExpression : ResourceExpression { #region Private fields. ///property member name private readonly Expression memberExpression; ///resource type private readonly Type resourceType; #endregion Private fields. ////// Creates a NavigationPropertySingletonExpression expression /// /// the return type of the expression /// the source expression /// property member name /// resource type for expression /// expand paths for resource set /// count option for the resource set /// custom query options for resourcse set /// projection expression internal NavigationPropertySingletonExpression(Type type, Expression source, Expression memberExpression, Type resourceType, ListexpandPaths, CountOption countOption, Dictionary customQueryOptions, ProjectionQueryOptionExpression projection) : base(source, (ExpressionType)ResourceExpressionType.ResourceNavigationPropertySingleton, type, expandPaths, countOption, customQueryOptions, projection) { Debug.Assert(memberExpression != null, "memberExpression != null"); Debug.Assert(resourceType != null, "resourceType != null"); this.memberExpression = memberExpression; this.resourceType = resourceType; } /// /// Gets the member expression. /// internal MemberExpression MemberExpression { get { return (MemberExpression)this.memberExpression; } } ////// The resource type of the singe instance produced by this singleton navigation. /// internal override Type ResourceType { get { return this.resourceType; } } ////// Singleton navigation properties always produce at most 1 result /// internal override bool IsSingleton { get { return true; } } ////// Does Singleton navigation have query options. /// internal override bool HasQueryOptions { get { return this.ExpandPaths.Count > 0 || this.CountOption == CountOption.InlineAll || this.CustomQueryOptions.Count > 0 || this.Projection != null; } } ////// Cast changes the type of the ResourceExpression /// /// new type ///new NavigationPropertySingletonExpression internal override ResourceExpression CreateCloneWithNewType(Type type) { return new NavigationPropertySingletonExpression( type, this.source, this.MemberExpression, TypeSystem.GetElementType(type), this.ExpandPaths.ToList(), this.CountOption, this.CustomQueryOptions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value), this.Projection); } } } // 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
- MetadataPropertyvalue.cs
- WebPermission.cs
- HMACSHA256.cs
- ManagementOptions.cs
- EmptyStringExpandableObjectConverter.cs
- AssemblyNameUtility.cs
- ExpressionReplacer.cs
- TimeIntervalCollection.cs
- BufferModesCollection.cs
- CapiNative.cs
- RelativeSource.cs
- TextRangeAdaptor.cs
- AnimationTimeline.cs
- DeflateStream.cs
- SafePointer.cs
- ArraySegment.cs
- MissingSatelliteAssemblyException.cs
- MiniLockedBorderGlyph.cs
- AudioFormatConverter.cs
- SynchronizedDispatch.cs
- SinglePageViewer.cs
- Part.cs
- prefixendpointaddressmessagefilter.cs
- EnvelopedPkcs7.cs
- ComboBox.cs
- CroppedBitmap.cs
- FastPropertyAccessor.cs
- MobileContainerDesigner.cs
- FixedSOMTextRun.cs
- _DigestClient.cs
- ApplyTemplatesAction.cs
- GeometryCollection.cs
- JsonFormatReaderGenerator.cs
- ListComponentEditor.cs
- MetadataWorkspace.cs
- DbConnectionFactory.cs
- RandomDelayQueuedSendsAsyncResult.cs
- WebPartCatalogCloseVerb.cs
- LicenseManager.cs
- XamlWrappingReader.cs
- XmlNamespaceMapping.cs
- Pkcs7Recipient.cs
- PermissionListSet.cs
- TextEditor.cs
- StyleSheetRefUrlEditor.cs
- UnionExpr.cs
- FontStyle.cs
- GestureRecognitionResult.cs
- LoginViewDesigner.cs
- ContentValidator.cs
- TargetControlTypeCache.cs
- ProviderConnectionPointCollection.cs
- IsolatedStorage.cs
- FrameworkContentElement.cs
- DateTimeStorage.cs
- BasicExpandProvider.cs
- RSACryptoServiceProvider.cs
- SapiRecoContext.cs
- PageRanges.cs
- LocationReference.cs
- DataGridViewElement.cs
- DiscoveryInnerClientAdhoc11.cs
- SpellerError.cs
- WsdlParser.cs
- ColorBlend.cs
- ReplyChannel.cs
- Slider.cs
- ValidationErrorEventArgs.cs
- WorkflowOperationBehavior.cs
- ServiceDesigner.cs
- SingleAnimationUsingKeyFrames.cs
- SessionPageStateSection.cs
- FormViewDeletedEventArgs.cs
- MailWriter.cs
- ChannelEndpointElementCollection.cs
- DataGridViewColumnConverter.cs
- BinaryObjectWriter.cs
- InternalTypeHelper.cs
- SqlCommand.cs
- ValidatingReaderNodeData.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- SharedPersonalizationStateInfo.cs
- EntityConnection.cs
- ImageCodecInfo.cs
- HwndKeyboardInputProvider.cs
- ApplicationServiceHelper.cs
- GroupBox.cs
- SessionStateContainer.cs
- EndpointAddressAugust2004.cs
- HotSpotCollection.cs
- BitVector32.cs
- OracleInternalConnection.cs
- InitializerFacet.cs
- SessionStateUtil.cs
- MiniCustomAttributeInfo.cs
- DecimalStorage.cs
- Logging.cs
- RootProfilePropertySettingsCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SchemaConstraints.cs