Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / ALinq / NavigationPropertySingletonExpression.cs / 3 / NavigationPropertySingletonExpression.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Respresents a navigation to a singleton property.
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services.Client
{
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Diagnostics;
/// ResourceSet Expression
internal class NavigationPropertySingletonExpression : ResourceExpression
{
/// source expression
private readonly Expression source;
/// property member name
private readonly Expression memberExpression;
///
/// Creates a NavigationPropertySingletonExpression expression
///
/// the return type of the expression
/// the source expression
/// property member name
/// expand paths for resource set
/// custom query options for resourcse set
internal NavigationPropertySingletonExpression(Type type, Expression source, Expression memberExpression, List expandPaths, Dictionary customQueryOptions)
: base((ExpressionType)ResourceExpressionType.ResourceNavigationPropertySingleton, type, expandPaths, customQueryOptions)
{
this.source = source;
this.memberExpression = memberExpression;
}
///
/// Gets the member expression.
///
internal MemberExpression MemberExpression
{
get
{
return (MemberExpression)this.memberExpression;
}
}
///
/// Gets the source expression.
///
internal Expression Source
{
get
{
return this.source;
}
}
///
/// The resource type of the singe instance produced by this singleton navigation.
///
internal override Type ResourceType
{
get { return this.memberExpression.Type; }
}
///
/// 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.CustomQueryOptions.Count > 0;
}
}
///
/// Cast changes the type of the ResourceExpression
///
/// new type
/// new NavigationPropertySingletonExpression
internal override ResourceExpression Cast(Type type)
{
NavigationPropertySingletonExpression rse = new NavigationPropertySingletonExpression(
type,
this.source,
this.MemberExpression,
this.ExpandPaths.ToList(),
this.CustomQueryOptions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
return rse;
}
}
}
// 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
{
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Diagnostics;
/// ResourceSet Expression
internal class NavigationPropertySingletonExpression : ResourceExpression
{
/// source expression
private readonly Expression source;
/// property member name
private readonly Expression memberExpression;
///
/// Creates a NavigationPropertySingletonExpression expression
///
/// the return type of the expression
/// the source expression
/// property member name
/// expand paths for resource set
/// custom query options for resourcse set
internal NavigationPropertySingletonExpression(Type type, Expression source, Expression memberExpression, List expandPaths, Dictionary customQueryOptions)
: base((ExpressionType)ResourceExpressionType.ResourceNavigationPropertySingleton, type, expandPaths, customQueryOptions)
{
this.source = source;
this.memberExpression = memberExpression;
}
///
/// Gets the member expression.
///
internal MemberExpression MemberExpression
{
get
{
return (MemberExpression)this.memberExpression;
}
}
///
/// Gets the source expression.
///
internal Expression Source
{
get
{
return this.source;
}
}
///
/// The resource type of the singe instance produced by this singleton navigation.
///
internal override Type ResourceType
{
get { return this.memberExpression.Type; }
}
///
/// 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.CustomQueryOptions.Count > 0;
}
}
///
/// Cast changes the type of the ResourceExpression
///
/// new type
/// new NavigationPropertySingletonExpression
internal override ResourceExpression Cast(Type type)
{
NavigationPropertySingletonExpression rse = new NavigationPropertySingletonExpression(
type,
this.source,
this.MemberExpression,
this.ExpandPaths.ToList(),
this.CustomQueryOptions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
return rse;
}
}
}
// 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
- DesignerCapabilities.cs
- IPipelineRuntime.cs
- XD.cs
- DropShadowBitmapEffect.cs
- ScriptBehaviorDescriptor.cs
- CacheMode.cs
- DbProviderFactories.cs
- ControlBuilder.cs
- ExtenderControl.cs
- ProcessManager.cs
- ProfileGroupSettings.cs
- PocoPropertyAccessorStrategy.cs
- InvokePatternIdentifiers.cs
- ServiceControllerDesigner.cs
- SingleKeyFrameCollection.cs
- ValidationSummary.cs
- TextParagraphView.cs
- TransportManager.cs
- Pen.cs
- ComplexBindingPropertiesAttribute.cs
- _ServiceNameStore.cs
- FrameDimension.cs
- control.ime.cs
- HttpWebResponse.cs
- Ref.cs
- EnumConverter.cs
- ReliableReplySessionChannel.cs
- CurrentTimeZone.cs
- TcpAppDomainProtocolHandler.cs
- TemplateBindingExtension.cs
- CorrelationManager.cs
- ImageClickEventArgs.cs
- SafeReadContext.cs
- BaseValidatorDesigner.cs
- UserControl.cs
- HebrewCalendar.cs
- SerializationInfo.cs
- MultiBinding.cs
- UnknownWrapper.cs
- WebPartDescriptionCollection.cs
- TransformGroup.cs
- ResourceManagerWrapper.cs
- XmlSchemaParticle.cs
- Library.cs
- SchemaAttDef.cs
- HtmlMeta.cs
- ValidationUtility.cs
- BuildProvidersCompiler.cs
- EntityViewGenerator.cs
- DesignerSerializationVisibilityAttribute.cs
- FragmentNavigationEventArgs.cs
- DataGridAutomationPeer.cs
- Double.cs
- DocumentEventArgs.cs
- DeferredTextReference.cs
- Privilege.cs
- ReliableMessagingVersionConverter.cs
- DataGridViewLinkCell.cs
- FlowDocumentPaginator.cs
- ECDsaCng.cs
- Transactions.cs
- ConfigXmlText.cs
- HttpResponseHeader.cs
- ActivityBuilderXamlWriter.cs
- IInstanceContextProvider.cs
- OdbcConnectionStringbuilder.cs
- WebPartTransformerCollection.cs
- ApplicationGesture.cs
- DisplayMemberTemplateSelector.cs
- ObjectHelper.cs
- ExpandCollapseProviderWrapper.cs
- NamespaceExpr.cs
- PersonalizationProviderCollection.cs
- ProviderConnectionPoint.cs
- IsolationInterop.cs
- DataTemplateSelector.cs
- QueryStatement.cs
- File.cs
- StyleSheet.cs
- ColorTransform.cs
- DbConnectionPool.cs
- RangeValidator.cs
- EasingQuaternionKeyFrame.cs
- RecordConverter.cs
- WebScriptClientGenerator.cs
- datacache.cs
- Publisher.cs
- SessionStateItemCollection.cs
- ColorBuilder.cs
- WriteFileContext.cs
- EditingCoordinator.cs
- ZipIOCentralDirectoryFileHeader.cs
- Menu.cs
- ToolStripDropDownClosingEventArgs.cs
- HiddenFieldPageStatePersister.cs
- TaskFormBase.cs
- UserValidatedEventArgs.cs
- CodeBinaryOperatorExpression.cs
- NetPipeSection.cs
- FtpWebRequest.cs