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
- DecoderBestFitFallback.cs
- TextServicesCompartmentEventSink.cs
- ProfileService.cs
- TextServicesProperty.cs
- PaintEvent.cs
- HandlerBase.cs
- Activator.cs
- KeyGestureConverter.cs
- PngBitmapDecoder.cs
- TempFiles.cs
- DocumentSchemaValidator.cs
- EntityDataSourceState.cs
- SystemDropShadowChrome.cs
- WsiProfilesElement.cs
- DataBindingHandlerAttribute.cs
- XslCompiledTransform.cs
- HtmlTableRowCollection.cs
- SoapConverter.cs
- InternalRelationshipCollection.cs
- PropertyConverter.cs
- MsmqProcessProtocolHandler.cs
- RegisteredDisposeScript.cs
- PropertyChange.cs
- SoapExtensionTypeElement.cs
- HostProtectionPermission.cs
- AccessedThroughPropertyAttribute.cs
- ListControl.cs
- StringStorage.cs
- DBNull.cs
- sqlinternaltransaction.cs
- ProfileManager.cs
- MessagePartSpecification.cs
- Win32Native.cs
- MatcherBuilder.cs
- QueryPageSettingsEventArgs.cs
- ServiceChannelFactory.cs
- QueryStringParameter.cs
- ToolStripComboBox.cs
- UncommonField.cs
- DataGridViewMethods.cs
- URLMembershipCondition.cs
- StylusButtonCollection.cs
- CurrencyManager.cs
- GeometryHitTestResult.cs
- UIPermission.cs
- DocumentViewer.cs
- Point3DAnimationUsingKeyFrames.cs
- CompilerGlobalScopeAttribute.cs
- IMembershipProvider.cs
- DiscoveryClientChannelBase.cs
- X509PeerCertificateAuthenticationElement.cs
- WebZone.cs
- SigningCredentials.cs
- EnlistmentTraceIdentifier.cs
- FixedTextView.cs
- XamlDesignerSerializationManager.cs
- ValidateNames.cs
- XmlSerializerFaultFormatter.cs
- arclist.cs
- RenderData.cs
- StringResourceManager.cs
- BindingExpressionBase.cs
- CachedBitmap.cs
- XmlExpressionDumper.cs
- WebPartCatalogCloseVerb.cs
- TreeIterator.cs
- WorkflowInlining.cs
- CompilationUnit.cs
- WebPartManagerDesigner.cs
- PageSetupDialog.cs
- CryptoConfig.cs
- AuthorizationPolicyTypeElementCollection.cs
- SafeEventLogWriteHandle.cs
- FormsAuthenticationUserCollection.cs
- PreviewKeyDownEventArgs.cs
- KnowledgeBase.cs
- SqlXmlStorage.cs
- SqlServices.cs
- DataRow.cs
- LinqDataSourceView.cs
- TypeInfo.cs
- TypeToArgumentTypeConverter.cs
- PropertyMetadata.cs
- ContentFileHelper.cs
- AddInControllerImpl.cs
- BaseTemplateParser.cs
- FileDetails.cs
- _NetRes.cs
- unsafeIndexingFilterStream.cs
- UseManagedPresentationElement.cs
- MetadataArtifactLoaderCompositeFile.cs
- TypeBuilderInstantiation.cs
- MsdtcClusterUtils.cs
- HostingPreferredMapPath.cs
- XmlSerializerFactory.cs
- Viewport3DVisual.cs
- PreservationFileWriter.cs
- WebPartRestoreVerb.cs
- Config.cs
- Queue.cs