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
- ExceptionDetail.cs
- SerializationInfoEnumerator.cs
- Listener.cs
- DebuggerAttributes.cs
- NativeMethods.cs
- CalendarDayButton.cs
- DetailsView.cs
- EmbossBitmapEffect.cs
- Clause.cs
- DataGridColumnHeaderAutomationPeer.cs
- TailCallAnalyzer.cs
- XmlSchemaDocumentation.cs
- HttpCapabilitiesBase.cs
- cache.cs
- ObjectView.cs
- sqlinternaltransaction.cs
- XmlQualifiedName.cs
- IgnoreSectionHandler.cs
- ContentFilePart.cs
- ResourceDescriptionAttribute.cs
- smtppermission.cs
- XsdDuration.cs
- GeneralTransformGroup.cs
- DataServiceRequest.cs
- ReadOnlyTernaryTree.cs
- TableCell.cs
- FileIOPermission.cs
- FixedSchema.cs
- Floater.cs
- StyleBamlTreeBuilder.cs
- CalendarTable.cs
- ObjectDataSourceEventArgs.cs
- DbTransaction.cs
- DiagnosticSection.cs
- StringExpressionSet.cs
- PropertyBuilder.cs
- EntityCommandExecutionException.cs
- LongAverageAggregationOperator.cs
- ReadWriteSpinLock.cs
- DependencyPropertyKey.cs
- GeneralTransformCollection.cs
- X509Certificate.cs
- UnionExpr.cs
- HwndMouseInputProvider.cs
- EventHandlingScope.cs
- SiteMapNode.cs
- ActivationServices.cs
- WMIInterop.cs
- XmlBinaryWriterSession.cs
- SqlHelper.cs
- ConfigurationValidatorBase.cs
- BindingListCollectionView.cs
- GridViewSortEventArgs.cs
- MulticastIPAddressInformationCollection.cs
- RsaSecurityTokenAuthenticator.cs
- InputBinding.cs
- DataError.cs
- EmptyCollection.cs
- DataGridViewLayoutData.cs
- SID.cs
- RegexCompiler.cs
- GPRECT.cs
- CalendarAutoFormat.cs
- SqlInfoMessageEvent.cs
- StreamWithDictionary.cs
- AbstractDataSvcMapFileLoader.cs
- GeneratedCodeAttribute.cs
- ConsoleKeyInfo.cs
- WebPartDisplayModeCollection.cs
- HtmlWindow.cs
- Ref.cs
- OleDbReferenceCollection.cs
- CustomAttribute.cs
- PageStatePersister.cs
- SeekStoryboard.cs
- Point3DKeyFrameCollection.cs
- Rotation3D.cs
- BamlStream.cs
- Buffer.cs
- SchemaImporter.cs
- TypeExtension.cs
- FieldNameLookup.cs
- KeyManager.cs
- Identity.cs
- XmlDataCollection.cs
- GenericRootAutomationPeer.cs
- TextEditorDragDrop.cs
- SystemUdpStatistics.cs
- Application.cs
- CodeParameterDeclarationExpression.cs
- XPathPatternBuilder.cs
- ZipArchive.cs
- OleDbConnectionFactory.cs
- WindowsToolbarAsMenu.cs
- UserInitiatedNavigationPermission.cs
- cookiecollection.cs
- HttpCapabilitiesSectionHandler.cs
- Rotation3D.cs
- XmlObjectSerializerWriteContext.cs
- DrawingContextWalker.cs