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
- XPathAxisIterator.cs
- PageAsyncTaskManager.cs
- RSAOAEPKeyExchangeDeformatter.cs
- EntitySqlException.cs
- ContainerUtilities.cs
- SqlPersonalizationProvider.cs
- DocComment.cs
- XmlAttributeCache.cs
- TemplateBuilder.cs
- NameService.cs
- TemporaryBitmapFile.cs
- ActivityExecutionContextCollection.cs
- RootBrowserWindowAutomationPeer.cs
- InheritanceRules.cs
- GestureRecognizer.cs
- ObfuscationAttribute.cs
- TCPListener.cs
- OleDbParameterCollection.cs
- DomainUpDown.cs
- MILUtilities.cs
- AppSecurityManager.cs
- DataBindingList.cs
- formatter.cs
- RemotingAttributes.cs
- OutputCacheProfileCollection.cs
- Library.cs
- Section.cs
- ToolStripDesigner.cs
- BooleanExpr.cs
- counter.cs
- EditorBrowsableAttribute.cs
- FigureParaClient.cs
- EncryptedKeyIdentifierClause.cs
- Int32KeyFrameCollection.cs
- DataGridViewRowHeaderCell.cs
- PackageDigitalSignatureManager.cs
- OneWayChannelFactory.cs
- SystemIcmpV6Statistics.cs
- Ipv6Element.cs
- hresults.cs
- RegexCapture.cs
- PatternMatcher.cs
- JoinTreeNode.cs
- XPathParser.cs
- XPathSelfQuery.cs
- ParserContext.cs
- UICuesEvent.cs
- TableHeaderCell.cs
- MouseCaptureWithinProperty.cs
- EntityClientCacheEntry.cs
- GcSettings.cs
- WebResourceUtil.cs
- Timer.cs
- SoapIncludeAttribute.cs
- LayoutTableCell.cs
- PageContent.cs
- WindowInteropHelper.cs
- WebChannelFactory.cs
- AuthenticationService.cs
- SpecialFolderEnumConverter.cs
- MasterPageParser.cs
- DataQuery.cs
- DecimalAnimationUsingKeyFrames.cs
- TextBox.cs
- LexicalChunk.cs
- DataListItemEventArgs.cs
- PageCodeDomTreeGenerator.cs
- SharedHttpsTransportManager.cs
- MappingException.cs
- ListViewAutomationPeer.cs
- BindableTemplateBuilder.cs
- WebMessageEncodingBindingElement.cs
- ErrorProvider.cs
- HelpInfo.cs
- Reference.cs
- MimeObjectFactory.cs
- Attributes.cs
- CacheRequest.cs
- DataColumnCollection.cs
- HotCommands.cs
- SingleKeyFrameCollection.cs
- InteropBitmapSource.cs
- RSAPKCS1SignatureDeformatter.cs
- XmlValidatingReaderImpl.cs
- OdbcRowUpdatingEvent.cs
- DataGridLinkButton.cs
- DrawingState.cs
- InheritedPropertyChangedEventArgs.cs
- InputMethod.cs
- Separator.cs
- StructuralCache.cs
- ConnectionOrientedTransportChannelListener.cs
- DesignerOptionService.cs
- ListSourceHelper.cs
- FixedSOMPage.cs
- Expression.cs
- CodeMemberMethod.cs
- CodeMemberProperty.cs
- ISFClipboardData.cs
- EventMappingSettingsCollection.cs