Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / compensatingcollection.cs / 1 / 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
- PolyLineSegment.cs
- PersonalizationProviderCollection.cs
- InProcStateClientManager.cs
- AVElementHelper.cs
- SiteMapNodeItem.cs
- cookieexception.cs
- RenderDataDrawingContext.cs
- WindowsSysHeader.cs
- Listbox.cs
- DefaultProxySection.cs
- SoapElementAttribute.cs
- DocumentGridContextMenu.cs
- SortKey.cs
- Comparer.cs
- ViewgenGatekeeper.cs
- AttributeCollection.cs
- IOException.cs
- SamlAuthenticationClaimResource.cs
- ChangePassword.cs
- Point.cs
- FlowDocumentPaginator.cs
- SystemInformation.cs
- FontNamesConverter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- NativeMethods.cs
- FillErrorEventArgs.cs
- TypedRowGenerator.cs
- XmlWriterSettings.cs
- RequestCacheValidator.cs
- MonthChangedEventArgs.cs
- Win32.cs
- NumberFormatInfo.cs
- SmtpSection.cs
- DetailsViewPagerRow.cs
- BinHexEncoder.cs
- CopyOfAction.cs
- NotifyParentPropertyAttribute.cs
- StreamWriter.cs
- TypeToTreeConverter.cs
- DocumentViewerBaseAutomationPeer.cs
- SerialStream.cs
- DecoderReplacementFallback.cs
- XmlNamespaceMapping.cs
- XmlNotation.cs
- DataSpaceManager.cs
- DataKey.cs
- SchemaImporterExtensionElementCollection.cs
- XmlSiteMapProvider.cs
- XmlSerializerImportOptions.cs
- Error.cs
- ListViewContainer.cs
- WorkflowCommandExtensionItem.cs
- Activator.cs
- TreeNodeStyle.cs
- ReadOnlyMetadataCollection.cs
- ExceptionHelpers.cs
- FusionWrap.cs
- Control.cs
- AuthenticationException.cs
- WmlValidationSummaryAdapter.cs
- Error.cs
- XmlSchemaSimpleTypeUnion.cs
- HandleValueEditor.cs
- NetworkStream.cs
- PrintPageEvent.cs
- ScriptingScriptResourceHandlerSection.cs
- ProtectedConfiguration.cs
- ToolStripItemImageRenderEventArgs.cs
- DesignerCommandSet.cs
- MatrixTransform3D.cs
- TaskFileService.cs
- WindowAutomationPeer.cs
- HashUtility.cs
- XmlDataSourceDesigner.cs
- WebPartVerbCollection.cs
- MouseEvent.cs
- Base64Decoder.cs
- IgnoreFileBuildProvider.cs
- SymbolPair.cs
- DesignerCommandAdapter.cs
- QueryableDataSourceView.cs
- Transform.cs
- ToolStripKeyboardHandlingService.cs
- HttpModulesSection.cs
- XmlChoiceIdentifierAttribute.cs
- TagMapCollection.cs
- GridViewRowPresenter.cs
- XmlDataSourceView.cs
- StorageRoot.cs
- SafeRightsManagementEnvironmentHandle.cs
- XPathExpr.cs
- XmlWrappingWriter.cs
- LockedAssemblyCache.cs
- DecoderFallbackWithFailureFlag.cs
- EdmItemCollection.cs
- HttpAsyncResult.cs
- ListItemConverter.cs
- AudioSignalProblemOccurredEventArgs.cs
- WindowsHyperlink.cs
- TdsParserStateObject.cs