Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlNodeChangedEventArgs.cs
- DataBoundControlHelper.cs
- XPathSelectionIterator.cs
- StylusTouchDevice.cs
- MemberDescriptor.cs
- TextRunProperties.cs
- PackageRelationshipCollection.cs
- KeyTime.cs
- AnnotationDocumentPaginator.cs
- Region.cs
- EditorAttribute.cs
- GroupItem.cs
- UdpChannelListener.cs
- TableParagraph.cs
- MergePropertyDescriptor.cs
- RetrieveVirtualItemEventArgs.cs
- TextureBrush.cs
- ToggleButtonAutomationPeer.cs
- ScrollChrome.cs
- followingsibling.cs
- WebPartExportVerb.cs
- RewritingProcessor.cs
- AdvancedBindingEditor.cs
- SpellerInterop.cs
- ISCIIEncoding.cs
- CompilerTypeWithParams.cs
- HwndMouseInputProvider.cs
- selecteditemcollection.cs
- ReachFixedPageSerializerAsync.cs
- TraceHandlerErrorFormatter.cs
- SoapEnumAttribute.cs
- CreateDataSourceDialog.cs
- IDQuery.cs
- GZipStream.cs
- MemoryStream.cs
- ListViewPagedDataSource.cs
- StylusPlugInCollection.cs
- InputScope.cs
- ReliabilityContractAttribute.cs
- BackgroundWorker.cs
- WorkflowRuntimeServicesBehavior.cs
- ParameterExpression.cs
- XamlTemplateSerializer.cs
- TimeZoneInfo.cs
- SchemaNotation.cs
- QuarticEase.cs
- ResourceDisplayNameAttribute.cs
- RemoteCryptoSignHashRequest.cs
- ellipse.cs
- Message.cs
- EventPrivateKey.cs
- StringTraceRecord.cs
- ObjectDisposedException.cs
- StorageRoot.cs
- ToolStripProgressBar.cs
- EntityContainerEmitter.cs
- PartialCachingControl.cs
- MemoryStream.cs
- TreeIterator.cs
- LinkConverter.cs
- XmlSchemaSimpleContentRestriction.cs
- DocumentViewerAutomationPeer.cs
- SoapSchemaImporter.cs
- StringComparer.cs
- ConditionalExpression.cs
- Animatable.cs
- ScalarConstant.cs
- CqlIdentifiers.cs
- DesignerListAdapter.cs
- TextTabProperties.cs
- COM2Properties.cs
- BitConverter.cs
- UIElementPropertyUndoUnit.cs
- Viewport2DVisual3D.cs
- PenThreadWorker.cs
- NameSpaceExtractor.cs
- ConfigurationLocation.cs
- ElasticEase.cs
- DataListItemEventArgs.cs
- RegexMatch.cs
- BooleanConverter.cs
- ValueSerializer.cs
- BitmapDecoder.cs
- CachedBitmap.cs
- SignerInfo.cs
- TraceUtility.cs
- Configuration.cs
- HTMLTagNameToTypeMapper.cs
- CssTextWriter.cs
- Point.cs
- BrowserInteropHelper.cs
- _HeaderInfo.cs
- XpsS0ValidatingLoader.cs
- SchemaObjectWriter.cs
- ProfileEventArgs.cs
- BitmapEffectInputData.cs
- DesignerSerializationVisibilityAttribute.cs
- TabletDevice.cs
- XPathNodeList.cs
- ExpressionVisitor.cs