Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- DataControlLinkButton.cs
- VisualTarget.cs
- XmlQueryStaticData.cs
- ExpressionEvaluator.cs
- ClaimComparer.cs
- OleDbInfoMessageEvent.cs
- XmlHierarchicalEnumerable.cs
- ProcessProtocolHandler.cs
- TransformPattern.cs
- SHA1CryptoServiceProvider.cs
- UIAgentMonitor.cs
- SqlAliasesReferenced.cs
- DrawingAttributes.cs
- MediaTimeline.cs
- ContentElementAutomationPeer.cs
- GroupBox.cs
- HwndStylusInputProvider.cs
- XmlMemberMapping.cs
- Normalizer.cs
- IdleTimeoutMonitor.cs
- ApplicationSecurityInfo.cs
- HttpPostedFile.cs
- EventOpcode.cs
- RootNamespaceAttribute.cs
- ConfigurationStrings.cs
- TraceContext.cs
- DataGridViewRowCollection.cs
- ConstantSlot.cs
- SoapFault.cs
- DictionaryKeyPropertyAttribute.cs
- ProfileService.cs
- XmlChildNodes.cs
- TreeSet.cs
- InputScopeManager.cs
- SequentialUshortCollection.cs
- DbDataReader.cs
- COM2Properties.cs
- AnimatedTypeHelpers.cs
- ViewSimplifier.cs
- CheckBoxBaseAdapter.cs
- GenericParameterDataContract.cs
- WebControlAdapter.cs
- WebPartConnectionCollection.cs
- NotifyCollectionChangedEventArgs.cs
- PartManifestEntry.cs
- CopyOfAction.cs
- DataServiceQueryOfT.cs
- SessionStateItemCollection.cs
- NameTable.cs
- CodeMemberMethod.cs
- ProxyWebPartConnectionCollection.cs
- XPathCompileException.cs
- WCFModelStrings.Designer.cs
- DataBindingCollection.cs
- rsa.cs
- EdmProperty.cs
- InkCanvasAutomationPeer.cs
- CommonRemoteMemoryBlock.cs
- HtmlButton.cs
- WebBrowserNavigatingEventHandler.cs
- TextProperties.cs
- UnsafeNativeMethods.cs
- SecurityTokenSerializer.cs
- DataServiceResponse.cs
- FrameworkElementFactoryMarkupObject.cs
- EntityDataReader.cs
- ICspAsymmetricAlgorithm.cs
- BaseTemplateBuildProvider.cs
- XmlSchemaDocumentation.cs
- Icon.cs
- TraceListeners.cs
- ChtmlTextWriter.cs
- LookupNode.cs
- DbProviderServices.cs
- HtmlLiteralTextAdapter.cs
- DelegatingTypeDescriptionProvider.cs
- CodeVariableReferenceExpression.cs
- VirtualDirectoryMappingCollection.cs
- Pool.cs
- EdmConstants.cs
- QilName.cs
- AspProxy.cs
- ExtractorMetadata.cs
- ScriptHandlerFactory.cs
- DefaultShape.cs
- UnsafeNativeMethods.cs
- XmlQualifiedName.cs
- SystemIcmpV4Statistics.cs
- ListItemParagraph.cs
- DiagnosticsConfiguration.cs
- ContainerUIElement3D.cs
- XPathItem.cs
- URIFormatException.cs
- JournalEntryStack.cs
- SecurityException.cs
- CodeGroup.cs
- MultilineStringConverter.cs
- XXXInfos.cs
- COM2PropertyDescriptor.cs
- ResourceCategoryAttribute.cs