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
- InheritedPropertyChangedEventArgs.cs
- Pair.cs
- GACMembershipCondition.cs
- DataGridViewRowPrePaintEventArgs.cs
- MetadataSerializer.cs
- PermissionSetEnumerator.cs
- StaticContext.cs
- ConnectionConsumerAttribute.cs
- WebServiceHandlerFactory.cs
- SqlRowUpdatingEvent.cs
- DbParameterCollection.cs
- ElementNotEnabledException.cs
- ExpressionParser.cs
- EventRoute.cs
- ServiceNameCollection.cs
- QueryStatement.cs
- ByteStack.cs
- RightsManagementEncryptedStream.cs
- itemelement.cs
- DateTimeOffset.cs
- SpeechSeg.cs
- WebMessageEncodingElement.cs
- _ConnectStream.cs
- Comparer.cs
- ButtonBase.cs
- DataTransferEventArgs.cs
- LabelDesigner.cs
- TemplateControlCodeDomTreeGenerator.cs
- StatusBarDrawItemEvent.cs
- PassportIdentity.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- DiagnosticTraceRecords.cs
- ColumnWidthChangingEvent.cs
- CngProvider.cs
- TdsParameterSetter.cs
- SchemaTableColumn.cs
- TableRow.cs
- PropertyEmitter.cs
- SplitterPanelDesigner.cs
- UnsafeNativeMethods.cs
- Workspace.cs
- SignatureTargetIdManager.cs
- MimeReturn.cs
- MarshalByValueComponent.cs
- ExceptionRoutedEventArgs.cs
- StylusDownEventArgs.cs
- AnnotationComponentManager.cs
- StaticResourceExtension.cs
- NavigationHelper.cs
- UITypeEditor.cs
- XhtmlTextWriter.cs
- OrCondition.cs
- QueryParameter.cs
- DataServiceHost.cs
- SafeNativeMethods.cs
- DataSetUtil.cs
- ListViewItem.cs
- BidOverLoads.cs
- DbConnectionPoolCounters.cs
- EncodingInfo.cs
- DataColumnMappingCollection.cs
- PathFigureCollection.cs
- ObjectViewEntityCollectionData.cs
- ToolStripOverflow.cs
- DebugView.cs
- CrossSiteScriptingValidation.cs
- ToolStripProgressBar.cs
- LayoutTable.cs
- BigInt.cs
- XmlParserContext.cs
- CompilerWrapper.cs
- XamlDesignerSerializationManager.cs
- ErrorFormatter.cs
- Crc32.cs
- ListViewItem.cs
- ProfessionalColorTable.cs
- Vector3DAnimationUsingKeyFrames.cs
- ComponentResourceKey.cs
- ComponentSerializationService.cs
- TemplateInstanceAttribute.cs
- View.cs
- XPathQilFactory.cs
- SharedPersonalizationStateInfo.cs
- DataSourceCollectionBase.cs
- DataBinding.cs
- VoiceObjectToken.cs
- PkcsMisc.cs
- TextBoxView.cs
- RowToParametersTransformer.cs
- ReachIDocumentPaginatorSerializer.cs
- HashLookup.cs
- ConsumerConnectionPointCollection.cs
- TimelineClockCollection.cs
- QuerySubExprEliminator.cs
- WindowsAuthenticationModule.cs
- ProxyWebPartConnectionCollection.cs
- RangeValuePatternIdentifiers.cs
- HostingEnvironment.cs
- XmlSerializerImportOptions.cs
- FileUpload.cs