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
- JournalNavigationScope.cs
- WasAdminWrapper.cs
- TextContainer.cs
- DesignerPainter.cs
- CompilationRelaxations.cs
- Style.cs
- ActivityPropertyReference.cs
- MultiPageTextView.cs
- PolicyStatement.cs
- GenericAuthenticationEventArgs.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- DataSourceExpression.cs
- xsdvalidator.cs
- Material.cs
- OutOfMemoryException.cs
- FontEditor.cs
- IconConverter.cs
- DesignerSerializationManager.cs
- ListMarkerLine.cs
- ColumnHeaderConverter.cs
- XhtmlBasicImageAdapter.cs
- SecureEnvironment.cs
- TextEditorParagraphs.cs
- Journaling.cs
- Visual3D.cs
- SwitchExpression.cs
- OneWayChannelFactory.cs
- DetailsViewPageEventArgs.cs
- InputEventArgs.cs
- ParenthesizePropertyNameAttribute.cs
- EdmMember.cs
- EventProvider.cs
- SelectionProcessor.cs
- TypeBuilderInstantiation.cs
- MarkerProperties.cs
- SafeNativeMethods.cs
- FileReader.cs
- ArraySubsetEnumerator.cs
- XPathNodeList.cs
- messageonlyhwndwrapper.cs
- XPathChildIterator.cs
- ConstructorNeedsTagAttribute.cs
- ECDiffieHellmanPublicKey.cs
- WebBaseEventKeyComparer.cs
- MetadataArtifactLoaderCompositeResource.cs
- QilInvokeLateBound.cs
- EdmFunction.cs
- QilInvokeLateBound.cs
- DirectoryRedirect.cs
- LoginName.cs
- MonthCalendarDesigner.cs
- DesignDataSource.cs
- BreakSafeBase.cs
- QilSortKey.cs
- AlphabetConverter.cs
- HtmlImageAdapter.cs
- ColorConvertedBitmapExtension.cs
- ZipIOLocalFileBlock.cs
- PageSetupDialog.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- XmlRawWriterWrapper.cs
- LinkButton.cs
- DecoratedNameAttribute.cs
- ExpressionVisitor.cs
- FusionWrap.cs
- Convert.cs
- DataSourceHelper.cs
- XamlTemplateSerializer.cs
- RemoteWebConfigurationHost.cs
- MenuBindingsEditorForm.cs
- UserControlAutomationPeer.cs
- XmlDataSource.cs
- XmlSerializerFactory.cs
- SourceFileBuildProvider.cs
- TextEvent.cs
- BooleanAnimationBase.cs
- PrimitiveSchema.cs
- Number.cs
- RuntimeWrappedException.cs
- Part.cs
- OutputScope.cs
- SQLDateTimeStorage.cs
- DesignerTextViewAdapter.cs
- XmlReaderSettings.cs
- XmlIterators.cs
- RelationshipSet.cs
- Rethrow.cs
- WebEventCodes.cs
- XmlUtf8RawTextWriter.cs
- EventKeyword.cs
- SchemaImporter.cs
- FlowDecisionLabelFeature.cs
- SplayTreeNode.cs
- ServiceDescriptionImporter.cs
- CompoundFileStreamReference.cs
- HttpCacheVaryByContentEncodings.cs
- CodeSnippetExpression.cs
- HighContrastHelper.cs
- EngineSiteSapi.cs
- WmfPlaceableFileHeader.cs