Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- SafeNativeMethods.cs
- XmlILTrace.cs
- CompilerParameters.cs
- NullableDecimalSumAggregationOperator.cs
- LazyInitializer.cs
- GreenMethods.cs
- LockRecursionException.cs
- DataRelation.cs
- InitializationEventAttribute.cs
- UrlAuthorizationModule.cs
- X509WindowsSecurityToken.cs
- ProgressBar.cs
- UndoEngine.cs
- NullRuntimeConfig.cs
- SortKey.cs
- RedistVersionInfo.cs
- ColorConverter.cs
- Matrix3D.cs
- ChangeProcessor.cs
- ClickablePoint.cs
- StorageMappingFragment.cs
- InteropBitmapSource.cs
- SQLInt16Storage.cs
- ExternalFile.cs
- ByteFacetDescriptionElement.cs
- FocusChangedEventArgs.cs
- PolicyImporterElement.cs
- VisualStateGroup.cs
- NotSupportedException.cs
- DesignTimeXamlWriter.cs
- MsmqChannelFactoryBase.cs
- ToolboxDataAttribute.cs
- DataGridViewDataConnection.cs
- DatatypeImplementation.cs
- TextEditorTables.cs
- GridViewRowCollection.cs
- Utils.cs
- ProgressBar.cs
- RectAnimationBase.cs
- EmptyControlCollection.cs
- SearchExpression.cs
- AutomationPatternInfo.cs
- ExtractedStateEntry.cs
- GeometryModel3D.cs
- UnknownWrapper.cs
- FullTextState.cs
- ToolStripContainerActionList.cs
- PointKeyFrameCollection.cs
- ToolStripLabel.cs
- StaticExtension.cs
- AuthenticationService.cs
- DataViewSetting.cs
- UnknownWrapper.cs
- HelpInfo.cs
- sapiproxy.cs
- PropertyIDSet.cs
- SQLInt16.cs
- EditorPartCollection.cs
- TemplateControl.cs
- MediaContextNotificationWindow.cs
- EventWaitHandle.cs
- ParsedAttributeCollection.cs
- PostBackTrigger.cs
- NameTable.cs
- XsdCachingReader.cs
- ConstraintStruct.cs
- SspiHelper.cs
- FormClosedEvent.cs
- RC2CryptoServiceProvider.cs
- OverflowException.cs
- Region.cs
- BuildResultCache.cs
- WebZone.cs
- DetailsViewInsertedEventArgs.cs
- XPathAxisIterator.cs
- StrokeCollection.cs
- WSHttpBindingBase.cs
- _IPv6Address.cs
- EntityContainerEntitySet.cs
- SchemaObjectWriter.cs
- DataFieldConverter.cs
- TextDecoration.cs
- mactripleDES.cs
- SqlCommandSet.cs
- DateTimeConverter.cs
- HashHelper.cs
- precedingsibling.cs
- WebPartDisplayModeCollection.cs
- Bind.cs
- DataSourceExpression.cs
- OptimizedTemplateContent.cs
- ArraySortHelper.cs
- UntrustedRecipientException.cs
- DocumentViewerAutomationPeer.cs
- SystemEvents.cs
- EntityTypeBase.cs
- CounterSetInstance.cs
- PaginationProgressEventArgs.cs
- LayoutEditorPart.cs
- SqlException.cs