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
- RelatedImageListAttribute.cs
- XmlCodeExporter.cs
- MediaSystem.cs
- Timer.cs
- SemaphoreFullException.cs
- DetailsViewModeEventArgs.cs
- EventLogPermissionAttribute.cs
- Permission.cs
- ClientTargetCollection.cs
- EdmComplexTypeAttribute.cs
- RectangleConverter.cs
- Formatter.cs
- ErrorFormatter.cs
- TitleStyle.cs
- PageVisual.cs
- BinaryObjectWriter.cs
- CssClassPropertyAttribute.cs
- SqlUtils.cs
- XmlIlGenerator.cs
- embossbitmapeffect.cs
- BinaryFormatter.cs
- EditBehavior.cs
- HtmlDocument.cs
- Directory.cs
- Parser.cs
- PassportPrincipal.cs
- TypeInfo.cs
- SQLBinaryStorage.cs
- PropertyGridView.cs
- CultureSpecificCharacterBufferRange.cs
- CommandField.cs
- BitmapEffectRenderDataResource.cs
- RuntimeWrappedException.cs
- InterleavedZipPartStream.cs
- ChannelManager.cs
- HtmlTextArea.cs
- EntityContainer.cs
- SqlStream.cs
- CopyAttributesAction.cs
- ArraySegment.cs
- DataRelation.cs
- BamlLocalizableResourceKey.cs
- InternalMappingException.cs
- XamlToRtfWriter.cs
- EntityPropertyMappingAttribute.cs
- TemplateComponentConnector.cs
- GenericUriParser.cs
- HttpProfileGroupBase.cs
- ElementHostAutomationPeer.cs
- WorkflowOperationBehavior.cs
- SafeMarshalContext.cs
- BamlTreeUpdater.cs
- PropertySourceInfo.cs
- ToolZoneDesigner.cs
- GetIsBrowserClientRequest.cs
- MonitoringDescriptionAttribute.cs
- ListSourceHelper.cs
- ReferenceSchema.cs
- EventLogEntryCollection.cs
- XMLSyntaxException.cs
- ThicknessAnimationBase.cs
- ReferencedCollectionType.cs
- PipelineModuleStepContainer.cs
- SerialStream.cs
- AnimatedTypeHelpers.cs
- OrderedDictionaryStateHelper.cs
- DbCommandTree.cs
- CheckBoxBaseAdapter.cs
- ProviderCollection.cs
- figurelength.cs
- ListDictionaryInternal.cs
- Currency.cs
- RootBuilder.cs
- WorkflowValidationFailedException.cs
- PreviewPageInfo.cs
- Lease.cs
- WorkflowInspectionServices.cs
- ReadOnlyDictionary.cs
- AdRotatorDesigner.cs
- unsafeIndexingFilterStream.cs
- ForeignConstraint.cs
- NewExpression.cs
- DataContractSerializerOperationFormatter.cs
- AgileSafeNativeMemoryHandle.cs
- XmlIlVisitor.cs
- StringCollectionEditor.cs
- ViewgenGatekeeper.cs
- HtmlGenericControl.cs
- ChangeDirector.cs
- DbLambda.cs
- CultureSpecificStringDictionary.cs
- XPathAxisIterator.cs
- TextLineResult.cs
- TextPenaltyModule.cs
- Pointer.cs
- DuplexChannelBinder.cs
- ReadOnlyDataSourceView.cs
- EnumValAlphaComparer.cs
- CodeMemberMethod.cs
- ButtonDesigner.cs