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 / Common / internal / materialization / compensatingcollection.cs / 1 / compensatingcollection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// [....]
//-----------------------------------------------------------------------------
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace System.Data.Common.Internal.Materialization
{
///
/// What we return from our materialization of a collection column must be
/// exactly the type that the compilers expected when they generated the
/// code that asked for it. This class wraps our enumerators and derives
/// from all the possible options, covering all the bases.
///
internal class CompensatingCollection : IOrderedQueryable, IOrderedEnumerable
{
#region private state
///
/// The thing we're compensating for
///
private readonly IEnumerable _source;
///
/// An expression that returns the source as a constant
///
private readonly Expression _expression;
#endregion
#region constructors
public CompensatingCollection(IEnumerable source)
{
_source = EntityUtil.CheckArgumentNull(source, "source");
_expression = Expression.Constant(source);
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return _source.GetEnumerator();
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return _source.GetEnumerator();
}
#endregion
#region IOrderedEnumerable Members
IOrderedEnumerable IOrderedEnumerable.CreateOrderedEnumerable(Func keySelector, IComparer comparer, bool descending)
{
throw EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_CreateOrderedEnumerableNotSupported);
}
#endregion
#region IQueryable Members
Type IQueryable.ElementType
{
get { return typeof(TElement); }
}
Expression IQueryable.Expression
{
get { return _expression; }
}
IQueryProvider IQueryable.Provider
{
get
{
throw EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnsupportedQueryableMethod);
}
}
#endregion
#region IQueryable Members
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// [....]
//-----------------------------------------------------------------------------
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace System.Data.Common.Internal.Materialization
{
///
/// What we return from our materialization of a collection column must be
/// exactly the type that the compilers expected when they generated the
/// code that asked for it. This class wraps our enumerators and derives
/// from all the possible options, covering all the bases.
///
internal class CompensatingCollection : IOrderedQueryable, IOrderedEnumerable
{
#region private state
///
/// The thing we're compensating for
///
private readonly IEnumerable _source;
///
/// An expression that returns the source as a constant
///
private readonly Expression _expression;
#endregion
#region constructors
public CompensatingCollection(IEnumerable source)
{
_source = EntityUtil.CheckArgumentNull(source, "source");
_expression = Expression.Constant(source);
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return _source.GetEnumerator();
}
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return _source.GetEnumerator();
}
#endregion
#region IOrderedEnumerable Members
IOrderedEnumerable IOrderedEnumerable.CreateOrderedEnumerable(Func keySelector, IComparer comparer, bool descending)
{
throw EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_CreateOrderedEnumerableNotSupported);
}
#endregion
#region IQueryable Members
Type IQueryable.ElementType
{
get { return typeof(TElement); }
}
Expression IQueryable.Expression
{
get { return _expression; }
}
IQueryProvider IQueryable.Provider
{
get
{
throw EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnsupportedQueryableMethod);
}
}
#endregion
#region IQueryable Members
#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
- SubMenuStyleCollection.cs
- DoubleLinkList.cs
- BufferedGraphicsManager.cs
- EventLogHandle.cs
- FactoryId.cs
- SqlMultiplexer.cs
- ReaderWriterLock.cs
- ToolTip.cs
- SessionStateModule.cs
- CodeTypeMemberCollection.cs
- WithParamAction.cs
- TextSelectionProcessor.cs
- ComponentChangedEvent.cs
- SmiEventStream.cs
- ListSortDescriptionCollection.cs
- FrugalList.cs
- Number.cs
- GeneralTransform2DTo3D.cs
- HatchBrush.cs
- GPPOINTF.cs
- FontEmbeddingManager.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- XmlQueryOutput.cs
- SiteMembershipCondition.cs
- StylusShape.cs
- ColorTranslator.cs
- WebEventCodes.cs
- EmbossBitmapEffect.cs
- DrawingContext.cs
- Material.cs
- sqlser.cs
- SqlDataSourceWizardForm.cs
- DataComponentGenerator.cs
- StreamUpgradeBindingElement.cs
- BindingGraph.cs
- DynamicRendererThreadManager.cs
- NativeBuffer.cs
- DbParameterCollection.cs
- MessageQueueCriteria.cs
- WizardPanel.cs
- DescriptionAttribute.cs
- AsymmetricCryptoHandle.cs
- SymmetricKey.cs
- GeneralEndpointIdentity.cs
- TextRunCache.cs
- JavaScriptString.cs
- ItemsChangedEventArgs.cs
- SegmentTree.cs
- MenuStrip.cs
- NativeMethods.cs
- StylusPointProperties.cs
- Int32RectValueSerializer.cs
- BorderGapMaskConverter.cs
- ComponentChangedEvent.cs
- TreeViewEvent.cs
- EventLogPermissionEntryCollection.cs
- RepeatButton.cs
- TypeConverterAttribute.cs
- IconHelper.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XPathNodeIterator.cs
- ViewStateChangedEventArgs.cs
- PauseStoryboard.cs
- CompilationUtil.cs
- BreakRecordTable.cs
- PackagingUtilities.cs
- SchemaTableColumn.cs
- Byte.cs
- DataGridViewColumnHeaderCell.cs
- TypeDescriptorFilterService.cs
- DataGridColumn.cs
- formatter.cs
- ValidationResult.cs
- FontStyle.cs
- RadioButton.cs
- TouchEventArgs.cs
- DesignTimeVisibleAttribute.cs
- SystemGatewayIPAddressInformation.cs
- RunWorkerCompletedEventArgs.cs
- MsmqIntegrationMessagePool.cs
- DesignerLoader.cs
- BoundField.cs
- SoapSchemaImporter.cs
- WinFormsSpinner.cs
- FunctionNode.cs
- InvariantComparer.cs
- InputLangChangeEvent.cs
- SQLBytesStorage.cs
- CorrelationScope.cs
- HyperlinkAutomationPeer.cs
- PartialList.cs
- Trace.cs
- TextCompositionManager.cs
- BulletChrome.cs
- XsdBuilder.cs
- RayHitTestParameters.cs
- SqlDataSourceCache.cs
- PageContentAsyncResult.cs
- WebPartConnectionsConnectVerb.cs
- CaseInsensitiveOrdinalStringComparer.cs