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
- ListControl.cs
- ListBoxItemWrapperAutomationPeer.cs
- ResourceWriter.cs
- Pens.cs
- TableCellCollection.cs
- dbdatarecord.cs
- TabItemAutomationPeer.cs
- NonVisualControlAttribute.cs
- StatementContext.cs
- PassportIdentity.cs
- OleDbRowUpdatingEvent.cs
- DataGridViewButtonColumn.cs
- FolderBrowserDialog.cs
- figurelength.cs
- Polygon.cs
- SecurityDescriptor.cs
- UIElementParagraph.cs
- HttpCachePolicyWrapper.cs
- DbgUtil.cs
- Schedule.cs
- DefaultValueTypeConverter.cs
- DesignTimeParseData.cs
- CounterSampleCalculator.cs
- EventItfInfo.cs
- PageAsyncTask.cs
- Tile.cs
- DataGridRelationshipRow.cs
- ConfigurationLocationCollection.cs
- Win32Exception.cs
- BrushConverter.cs
- FragmentNavigationEventArgs.cs
- XPathDocument.cs
- ZoneLinkButton.cs
- SmtpAuthenticationManager.cs
- XmlExceptionHelper.cs
- Dynamic.cs
- XmlSerializationGeneratedCode.cs
- BinaryObjectReader.cs
- DifferencingCollection.cs
- InputLanguageCollection.cs
- XPathNavigator.cs
- RSAPKCS1SignatureDeformatter.cs
- BamlMapTable.cs
- DataObjectPastingEventArgs.cs
- SystemInformation.cs
- ValidatingReaderNodeData.cs
- ConnectionStringSettingsCollection.cs
- CodeMemberMethod.cs
- DataGridCaption.cs
- ToolStripContainerDesigner.cs
- MemberHolder.cs
- SimpleType.cs
- ProfileSection.cs
- ObjectQueryState.cs
- DataGridViewRowPostPaintEventArgs.cs
- X500Name.cs
- GridViewCancelEditEventArgs.cs
- ImageMapEventArgs.cs
- ValidatorUtils.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- PixelFormats.cs
- TrackBarDesigner.cs
- FigureParagraph.cs
- Wildcard.cs
- SqlClientMetaDataCollectionNames.cs
- ProcessThread.cs
- DesignerRegionMouseEventArgs.cs
- HtmlInputImage.cs
- CodeBlockBuilder.cs
- SimpleHandlerBuildProvider.cs
- IndexedWhereQueryOperator.cs
- GridViewUpdateEventArgs.cs
- WebMessageEncoderFactory.cs
- MasterPageParser.cs
- XmlDownloadManager.cs
- TempEnvironment.cs
- CapacityStreamGeometryContext.cs
- RuleSettingsCollection.cs
- EntityRecordInfo.cs
- ListBoxItemAutomationPeer.cs
- GridEntryCollection.cs
- StructuredTypeInfo.cs
- ProcessThreadDesigner.cs
- DataShape.cs
- DataTablePropertyDescriptor.cs
- Decimal.cs
- CollectionChangeEventArgs.cs
- ErrorsHelper.cs
- MatrixCamera.cs
- ExpressionPrefixAttribute.cs
- arabicshape.cs
- LexicalChunk.cs
- EventProviderClassic.cs
- DictionaryBase.cs
- FileDialogPermission.cs
- TextPenaltyModule.cs
- ScriptReferenceBase.cs
- xamlnodes.cs
- FixedBufferAttribute.cs
- TextDecoration.cs