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
- XPathItem.cs
- MiniParameterInfo.cs
- RestHandler.cs
- CharKeyFrameCollection.cs
- ExceptionHelpers.cs
- safesecurityhelperavalon.cs
- HuffModule.cs
- HttpResponse.cs
- EFTableProvider.cs
- SspiHelper.cs
- Avt.cs
- AmbientLight.cs
- FlowLayoutSettings.cs
- ErrorTableItemStyle.cs
- MediaPlayer.cs
- StringFunctions.cs
- NonSerializedAttribute.cs
- DateTimeFormat.cs
- InvalidCastException.cs
- EncryptedData.cs
- ResourceReader.cs
- ZoneMembershipCondition.cs
- RelationalExpressions.cs
- FileResponseElement.cs
- XmlSchemaInfo.cs
- ImageSourceConverter.cs
- ByteAnimation.cs
- SessionIDManager.cs
- uribuilder.cs
- ThemeDirectoryCompiler.cs
- WrappedIUnknown.cs
- LinkConverter.cs
- BindingSourceDesigner.cs
- DataColumnMappingCollection.cs
- PointCollection.cs
- ListMarkerLine.cs
- ColorConverter.cs
- EditorPart.cs
- SafeBitVector32.cs
- PerformanceCounterLib.cs
- CardSpaceException.cs
- XmlCharCheckingReader.cs
- ServiceOperation.cs
- TextTreeNode.cs
- TraceProvider.cs
- QueryGeneratorBase.cs
- ModelItemKeyValuePair.cs
- ApplicationHost.cs
- FileInfo.cs
- WebPartVerb.cs
- BitVector32.cs
- MemberJoinTreeNode.cs
- DbProviderFactoriesConfigurationHandler.cs
- TemplatedMailWebEventProvider.cs
- SizeAnimationClockResource.cs
- MimeMultiPart.cs
- EmptyStringExpandableObjectConverter.cs
- CatalogPart.cs
- PrintSchema.cs
- DataGridViewCellLinkedList.cs
- BaseCAMarshaler.cs
- TemplateControl.cs
- HttpCapabilitiesBase.cs
- odbcmetadatacolumnnames.cs
- MbpInfo.cs
- XmlQualifiedName.cs
- URLAttribute.cs
- CatalogZoneBase.cs
- DrawingVisualDrawingContext.cs
- StylusPointPropertyUnit.cs
- DriveInfo.cs
- FlowLayoutPanel.cs
- DocumentPageView.cs
- InternalCache.cs
- DataGridState.cs
- TemplateNameScope.cs
- SettingsPropertyNotFoundException.cs
- QilSortKey.cs
- VirtualPath.cs
- BuildProvidersCompiler.cs
- XmlArrayItemAttribute.cs
- RowCache.cs
- RelatedEnd.cs
- ElapsedEventArgs.cs
- ScaleTransform3D.cs
- BookmarkTable.cs
- HandlerWithFactory.cs
- DataTablePropertyDescriptor.cs
- ImageListDesigner.cs
- RepeaterItem.cs
- AssemblySettingAttributes.cs
- DebugView.cs
- UserUseLicenseDictionaryLoader.cs
- EnumMemberAttribute.cs
- EtwTrace.cs
- DBNull.cs
- RegisteredArrayDeclaration.cs
- TreeNodeCollection.cs
- DateTimeConverter.cs
- ObjectReaderCompiler.cs