Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / compensatingcollection.cs / 1305376 / 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(IEnumerablesource) { _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
- StorageAssociationTypeMapping.cs
- EndOfStreamException.cs
- FileReservationCollection.cs
- XmlSchemaSimpleTypeUnion.cs
- DefaultEventAttribute.cs
- ArglessEventHandlerProxy.cs
- ListItemDetailViewAttribute.cs
- ResponseBodyWriter.cs
- LinqDataSourceInsertEventArgs.cs
- ElapsedEventArgs.cs
- DataGridLength.cs
- ProbeMatchesMessageCD1.cs
- ThreadStartException.cs
- Condition.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- TypeResolver.cs
- BooleanFacetDescriptionElement.cs
- EntityContainerAssociationSet.cs
- OdbcException.cs
- SessionStateItemCollection.cs
- PageSetupDialog.cs
- MailWebEventProvider.cs
- _LoggingObject.cs
- AsyncOperationManager.cs
- Substitution.cs
- DocumentEventArgs.cs
- SqlStream.cs
- EncryptedReference.cs
- FlowDocumentReaderAutomationPeer.cs
- LocalValueEnumerator.cs
- _ChunkParse.cs
- HasActivatableWorkflowEvent.cs
- XPathDescendantIterator.cs
- ControlParameter.cs
- EnumerationRangeValidationUtil.cs
- BaseDataList.cs
- SolidColorBrush.cs
- DesignTimeHTMLTextWriter.cs
- MeshGeometry3D.cs
- Label.cs
- TextBreakpoint.cs
- ProgressBar.cs
- NonParentingControl.cs
- ADMembershipUser.cs
- MatrixAnimationUsingKeyFrames.cs
- RichTextBox.cs
- GridView.cs
- ErrorTableItemStyle.cs
- TraversalRequest.cs
- PartBasedPackageProperties.cs
- OdbcRowUpdatingEvent.cs
- XmlCompatibilityReader.cs
- DataGridCell.cs
- HtmlLabelAdapter.cs
- ResourceProviderFactory.cs
- AnchoredBlock.cs
- ConstructorNeedsTagAttribute.cs
- PresentationTraceSources.cs
- DefaultCommandConverter.cs
- Memoizer.cs
- UnmanagedMemoryStream.cs
- ContractUtils.cs
- PtsPage.cs
- TreeViewItemAutomationPeer.cs
- CellParaClient.cs
- Int32Rect.cs
- ExtendedProperty.cs
- MenuCommand.cs
- SecuritySessionSecurityTokenProvider.cs
- Calendar.cs
- HttpAsyncResult.cs
- CrossAppDomainChannel.cs
- IxmlLineInfo.cs
- ConnectionString.cs
- XmlNotation.cs
- MarginCollapsingState.cs
- DbCommandDefinition.cs
- Socket.cs
- Activity.cs
- IListConverters.cs
- log.cs
- EditorPartChrome.cs
- CompiledRegexRunnerFactory.cs
- Interlocked.cs
- TextUtf8RawTextWriter.cs
- AutoScrollHelper.cs
- DataColumnMappingCollection.cs
- XmlEncApr2001.cs
- CryptoHandle.cs
- NetworkCredential.cs
- DataGridDetailsPresenter.cs
- ValidatorUtils.cs
- DocumentReference.cs
- AnnotationDocumentPaginator.cs
- KeyEvent.cs
- MediaElementAutomationPeer.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- Select.cs
- X509ChainElement.cs
- HotCommands.cs