Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ExpressionVisitorHelpers.cs / 1 / ExpressionVisitorHelpers.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Diagnostics; using System.Data; namespace System.Linq.Expressions { // Because we are using the source file for ExpressionVistor from System.Core // we need to add code to facilitate some external calls that ExpressionVisitor makes. // The classes in this file do that. internal static class Error { internal static Exception UnhandledExpressionType(ExpressionType expressionType) { return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledExpressionType(expressionType)); } internal static Exception UnhandledBindingType(MemberBindingType memberBindingType) { return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledBindingType(memberBindingType)); } } internal static class ReadOnlyCollectionExtensions { internal static ReadOnlyCollectionToReadOnlyCollection (this IEnumerable sequence) { if (sequence == null) return DefaultReadOnlyCollection .Empty; ReadOnlyCollection col = sequence as ReadOnlyCollection ; if (col != null) return col; return new ReadOnlyCollection (sequence.ToArray()); } private static class DefaultReadOnlyCollection { private static ReadOnlyCollection _defaultCollection; internal static ReadOnlyCollection Empty { get { if (_defaultCollection == null) _defaultCollection = new ReadOnlyCollection (new T[] { }); return _defaultCollection; } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Diagnostics; using System.Data; namespace System.Linq.Expressions { // Because we are using the source file for ExpressionVistor from System.Core // we need to add code to facilitate some external calls that ExpressionVisitor makes. // The classes in this file do that. internal static class Error { internal static Exception UnhandledExpressionType(ExpressionType expressionType) { return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledExpressionType(expressionType)); } internal static Exception UnhandledBindingType(MemberBindingType memberBindingType) { return EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledBindingType(memberBindingType)); } } internal static class ReadOnlyCollectionExtensions { internal static ReadOnlyCollectionToReadOnlyCollection (this IEnumerable sequence) { if (sequence == null) return DefaultReadOnlyCollection .Empty; ReadOnlyCollection col = sequence as ReadOnlyCollection ; if (col != null) return col; return new ReadOnlyCollection (sequence.ToArray()); } private static class DefaultReadOnlyCollection { private static ReadOnlyCollection _defaultCollection; internal static ReadOnlyCollection Empty { get { if (_defaultCollection == null) _defaultCollection = new ReadOnlyCollection (new T[] { }); return _defaultCollection; } } } } } // 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
- ChannelFactoryRefCache.cs
- PointLightBase.cs
- TextRunCache.cs
- NullReferenceException.cs
- PolyBezierSegmentFigureLogic.cs
- DataServiceBuildProvider.cs
- LockCookie.cs
- SystemGatewayIPAddressInformation.cs
- ToolboxItemAttribute.cs
- odbcmetadatacollectionnames.cs
- VerificationAttribute.cs
- DialogResultConverter.cs
- WSMessageEncoding.cs
- OleDbMetaDataFactory.cs
- UrlMapping.cs
- AtomEntry.cs
- COM2Properties.cs
- PipelineModuleStepContainer.cs
- UnknownBitmapDecoder.cs
- HitTestWithGeometryDrawingContextWalker.cs
- CompoundFileReference.cs
- OdbcDataAdapter.cs
- TrackingServices.cs
- BufferBuilder.cs
- ObjectNotFoundException.cs
- WinFormsSecurity.cs
- DocumentOrderQuery.cs
- ShaderEffect.cs
- BuildProvidersCompiler.cs
- TextPatternIdentifiers.cs
- LayoutInformation.cs
- TableCellCollection.cs
- PeerApplication.cs
- DesignBindingConverter.cs
- KeyValuePair.cs
- XmlDataCollection.cs
- SafeProcessHandle.cs
- CustomErrorsSection.cs
- SelectionItemPattern.cs
- MiniParameterInfo.cs
- DataMember.cs
- CssTextWriter.cs
- UnitySerializationHolder.cs
- HttpRequestCacheValidator.cs
- OracleException.cs
- CompiledQueryCacheEntry.cs
- ProcessHostServerConfig.cs
- DrawingVisual.cs
- QilValidationVisitor.cs
- RtfNavigator.cs
- Label.cs
- SiteMapNodeItem.cs
- TypeHelper.cs
- BindStream.cs
- WindowsStartMenu.cs
- IList.cs
- SqlSelectStatement.cs
- CompleteWizardStep.cs
- EntitySqlException.cs
- XmlNode.cs
- EventLogTraceListener.cs
- _CommandStream.cs
- InputGestureCollection.cs
- NamedPipeTransportElement.cs
- Point4DConverter.cs
- PropertyEntry.cs
- SemanticBasicElement.cs
- DES.cs
- KeyFrames.cs
- SelectManyQueryOperator.cs
- ServiceNameCollection.cs
- PathSegment.cs
- ExecutorLocksHeldException.cs
- SerialStream.cs
- PrimitiveXmlSerializers.cs
- CannotUnloadAppDomainException.cs
- XmlBinaryReaderSession.cs
- AssemblyResolver.cs
- PerfCounters.cs
- SessionEndingEventArgs.cs
- AutomationPeer.cs
- XPathNodeInfoAtom.cs
- SoapSchemaImporter.cs
- SQLConvert.cs
- Console.cs
- SpellerInterop.cs
- DataList.cs
- AssemblyName.cs
- XmlSchemaNotation.cs
- HtmlInputReset.cs
- UInt32Storage.cs
- SpanIndex.cs
- IndexOutOfRangeException.cs
- DataObjectMethodAttribute.cs
- EpmSyndicationContentDeSerializer.cs
- StorageComplexPropertyMapping.cs
- XslNumber.cs
- GridViewCommandEventArgs.cs
- TableDetailsCollection.cs
- DependencyObjectPropertyDescriptor.cs