Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // // 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
- TimeSpanValidator.cs
- HttpValueCollection.cs
- PriorityQueue.cs
- PreservationFileWriter.cs
- StringSorter.cs
- ListDictionary.cs
- HideDisabledControlAdapter.cs
- RTTrackingProfile.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SafeFindHandle.cs
- ArgumentsParser.cs
- IODescriptionAttribute.cs
- IgnorePropertiesAttribute.cs
- DataChangedEventManager.cs
- RemoteWebConfigurationHostStream.cs
- FamilyTypeface.cs
- DataGridItemAutomationPeer.cs
- StylusTip.cs
- ViewDesigner.cs
- HttpContextBase.cs
- RuleProcessor.cs
- ContainerCodeDomSerializer.cs
- AvTrace.cs
- XPathDocumentNavigator.cs
- SystemTcpStatistics.cs
- TextDecoration.cs
- ReflectEventDescriptor.cs
- PresentationTraceSources.cs
- SoapTypeAttribute.cs
- TableLayoutPanelCellPosition.cs
- MSG.cs
- DataIdProcessor.cs
- GridSplitterAutomationPeer.cs
- IdentitySection.cs
- WebPartConnectVerb.cs
- ClosableStream.cs
- NativeMethods.cs
- InputBinding.cs
- HtmlInputFile.cs
- SafeFileHandle.cs
- Point3DAnimation.cs
- StreamWriter.cs
- SqlDesignerDataSourceView.cs
- RelatedCurrencyManager.cs
- InfoCardPolicy.cs
- WizardStepBase.cs
- TableCell.cs
- TreeNodeBinding.cs
- PointConverter.cs
- ObjectItemLoadingSessionData.cs
- ProjectionCamera.cs
- ConversionContext.cs
- CriticalExceptions.cs
- StatusBarAutomationPeer.cs
- ExpressionConverter.cs
- Vector3DCollectionValueSerializer.cs
- MouseButton.cs
- TextCompositionEventArgs.cs
- SimpleType.cs
- DBSqlParserTableCollection.cs
- InProcStateClientManager.cs
- MatrixTransform.cs
- BamlVersionHeader.cs
- RequestQueue.cs
- EditorPart.cs
- WindowCollection.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- HandlerBase.cs
- Compensate.cs
- PreloadedPackages.cs
- Pts.cs
- CommonServiceBehaviorElement.cs
- HwndHost.cs
- WeakReference.cs
- ConditionalWeakTable.cs
- TemplateControlBuildProvider.cs
- TreeNodeSelectionProcessor.cs
- SearchForVirtualItemEventArgs.cs
- DataGridViewColumn.cs
- StorageBasedPackageProperties.cs
- Timer.cs
- ImageListStreamer.cs
- DiscoveryReferences.cs
- configsystem.cs
- TabControlEvent.cs
- ServiceElement.cs
- TypedOperationInfo.cs
- FixedHyperLink.cs
- NativeObjectSecurity.cs
- ProcessHostMapPath.cs
- BinaryMethodMessage.cs
- Debug.cs
- DesignOnlyAttribute.cs
- Figure.cs
- EventLogEntryCollection.cs
- MenuItem.cs
- CodeExporter.cs
- OleDbParameter.cs
- TypeUsage.cs
- CfgSemanticTag.cs