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
- NavigatorInput.cs
- SettingsPropertyWrongTypeException.cs
- SqlMethodCallConverter.cs
- AttachedPropertyMethodSelector.cs
- MouseOverProperty.cs
- EdmItemError.cs
- XmlLinkedNode.cs
- WindowsFormsSynchronizationContext.cs
- ProfileGroupSettingsCollection.cs
- Vector3D.cs
- OleDbReferenceCollection.cs
- CreateParams.cs
- WindowsRegion.cs
- ItemChangedEventArgs.cs
- DataGridCell.cs
- WebBrowser.cs
- SocketPermission.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- SiteMapPath.cs
- SelectionChangedEventArgs.cs
- _SSPISessionCache.cs
- ImplicitInputBrush.cs
- ListViewPagedDataSource.cs
- ResourceManagerWrapper.cs
- PhysicalAddress.cs
- LinearQuaternionKeyFrame.cs
- OrderedDictionary.cs
- AccessControlEntry.cs
- UserControl.cs
- ActionFrame.cs
- XhtmlStyleClass.cs
- PublishLicense.cs
- OpenTypeLayout.cs
- CompensationHandlingFilter.cs
- UpdateException.cs
- RunInstallerAttribute.cs
- datacache.cs
- DataServiceQueryException.cs
- Point.cs
- IdnMapping.cs
- XDRSchema.cs
- ObjectViewListener.cs
- DataGridColumn.cs
- BuildProviderAppliesToAttribute.cs
- basecomparevalidator.cs
- GridViewRowCollection.cs
- DesignerForm.cs
- SmtpLoginAuthenticationModule.cs
- ChineseLunisolarCalendar.cs
- _HTTPDateParse.cs
- FamilyTypeface.cs
- CollectionConverter.cs
- AttributeEmitter.cs
- SplitterPanel.cs
- DateTime.cs
- AuthenticationConfig.cs
- XPathAncestorQuery.cs
- SafeHandles.cs
- NamespaceDisplay.xaml.cs
- X509UI.cs
- Model3DGroup.cs
- TemplateBindingExpressionConverter.cs
- MatrixTransform3D.cs
- LinkLabel.cs
- InvalidEnumArgumentException.cs
- ToolStripPanelCell.cs
- HwndSource.cs
- VisualProxy.cs
- Stopwatch.cs
- AdornerHitTestResult.cs
- ClientScriptManager.cs
- AnimationLayer.cs
- Buffer.cs
- GlobalDataBindingHandler.cs
- FactoryMaker.cs
- XPathNodeList.cs
- ConfigurationSection.cs
- SoapFault.cs
- DashStyles.cs
- FormCollection.cs
- ContextMenu.cs
- ProxyManager.cs
- ContextProperty.cs
- InstalledVoice.cs
- TableRowsCollectionEditor.cs
- ConfigurationSectionCollection.cs
- DescendantOverDescendantQuery.cs
- ReaderContextStackData.cs
- Block.cs
- TextEditorMouse.cs
- DocumentAutomationPeer.cs
- HttpWriter.cs
- TrustManagerPromptUI.cs
- ObjectViewListener.cs
- GenericPrincipal.cs
- CertificateManager.cs
- SqlGenerator.cs
- InputScopeConverter.cs
- CodeDefaultValueExpression.cs
- HostingPreferredMapPath.cs