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
- RectangleGeometry.cs
- RoamingStoreFileUtility.cs
- Set.cs
- DataTableTypeConverter.cs
- SortDescriptionCollection.cs
- OperationPerformanceCounters.cs
- RightsManagementEncryptionTransform.cs
- TypeConverterHelper.cs
- ConfigurationPermission.cs
- ListParagraph.cs
- BamlLocalizer.cs
- DataServiceRequestOfT.cs
- Source.cs
- WindowsListViewSubItem.cs
- ValidatorUtils.cs
- SqlIdentifier.cs
- HMACMD5.cs
- XamlSerializerUtil.cs
- ColumnCollection.cs
- Quaternion.cs
- MailAddressCollection.cs
- XmlSchemaSimpleType.cs
- SqlClientPermission.cs
- ExceptionValidationRule.cs
- SystemSounds.cs
- FixedNode.cs
- DataControlButton.cs
- CompModHelpers.cs
- InitializationEventAttribute.cs
- MetadataProperty.cs
- XsltQilFactory.cs
- Point3DCollectionConverter.cs
- MultiPageTextView.cs
- DocumentPageView.cs
- ReadWriteSpinLock.cs
- HttpContext.cs
- ArrayItemReference.cs
- RbTree.cs
- Helpers.cs
- Pair.cs
- PrintingPermissionAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- ModulesEntry.cs
- DataControlFieldCollection.cs
- smtppermission.cs
- ChtmlCalendarAdapter.cs
- SolidBrush.cs
- DataGridViewDataConnection.cs
- CodeSnippetTypeMember.cs
- TabItemWrapperAutomationPeer.cs
- SQLUtility.cs
- FontDialog.cs
- HwndAppCommandInputProvider.cs
- MobileCategoryAttribute.cs
- XmlSchema.cs
- Stylesheet.cs
- HtmlElementEventArgs.cs
- Set.cs
- ExtendedProtectionPolicyElement.cs
- Row.cs
- LogSwitch.cs
- HtmlValidationSummaryAdapter.cs
- ChangeNode.cs
- WpfKnownMember.cs
- DbTransaction.cs
- StringAnimationUsingKeyFrames.cs
- ItemCheckedEvent.cs
- DataSetMappper.cs
- EntitySqlQueryCacheEntry.cs
- PackageRelationship.cs
- TableLayoutPanel.cs
- DbDataAdapter.cs
- UnionCqlBlock.cs
- ToolStripSplitStackLayout.cs
- ContentDisposition.cs
- CompensateDesigner.cs
- HostnameComparisonMode.cs
- TreeViewDesigner.cs
- ConsoleTraceListener.cs
- LabelEditEvent.cs
- BindingOperations.cs
- XamlFilter.cs
- ZipIOFileItemStream.cs
- HostedImpersonationContext.cs
- TreeViewItem.cs
- DesignerHierarchicalDataSourceView.cs
- BridgeDataReader.cs
- XmlValidatingReader.cs
- OutOfMemoryException.cs
- GroupDescription.cs
- TypeLibraryHelper.cs
- ToolboxBitmapAttribute.cs
- RawUIStateInputReport.cs
- XMLSchema.cs
- TextBlock.cs
- SmtpLoginAuthenticationModule.cs
- DecimalFormatter.cs
- Dump.cs
- DiscoveryInnerClientManaged11.cs
- BooleanFunctions.cs