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
- WarningException.cs
- DataServiceProcessingPipelineEventArgs.cs
- DefaultParameterValueAttribute.cs
- XmlDocumentViewSchema.cs
- ExpressionCopier.cs
- TableRow.cs
- ExceptionHelpers.cs
- DaylightTime.cs
- DefaultSection.cs
- XmlSchemaType.cs
- _PooledStream.cs
- SoapCodeExporter.cs
- login.cs
- Function.cs
- ApplicationDirectoryMembershipCondition.cs
- BaseResourcesBuildProvider.cs
- CharAnimationUsingKeyFrames.cs
- AuthenticationServiceManager.cs
- CompilationUnit.cs
- StylusPoint.cs
- HtmlCalendarAdapter.cs
- OverflowException.cs
- WindowsAltTab.cs
- ScrollChrome.cs
- Int32Rect.cs
- AssertSection.cs
- LockRecursionException.cs
- EncoderFallback.cs
- ContentValidator.cs
- TokenizerHelper.cs
- ListViewUpdateEventArgs.cs
- RequestCacheEntry.cs
- SafeArrayRankMismatchException.cs
- SqlReorderer.cs
- OutOfProcStateClientManager.cs
- ScaleTransform.cs
- Substitution.cs
- Vector3dCollection.cs
- PrintingPermission.cs
- XmlEnumAttribute.cs
- EdmMember.cs
- BrowserCapabilitiesCompiler.cs
- CodeMemberField.cs
- ProfileGroupSettings.cs
- FileSystemInfo.cs
- RegistryPermission.cs
- DataMemberListEditor.cs
- CodeRemoveEventStatement.cs
- TextPointer.cs
- DiagnosticEventProvider.cs
- HandledEventArgs.cs
- MetaModel.cs
- ObjectStorage.cs
- PropertyChangingEventArgs.cs
- Or.cs
- PersonalizableAttribute.cs
- ContentElement.cs
- ContentDesigner.cs
- ControlUtil.cs
- ProvideValueServiceProvider.cs
- XPathNavigatorKeyComparer.cs
- ChannelSinkStacks.cs
- DBConnectionString.cs
- GraphicsState.cs
- ErrorEventArgs.cs
- BigInt.cs
- ConsumerConnectionPoint.cs
- WindowsFont.cs
- basecomparevalidator.cs
- LogEntryDeserializer.cs
- ListBase.cs
- RootBuilder.cs
- DeploymentSectionCache.cs
- TextLineResult.cs
- TaskHelper.cs
- AffineTransform3D.cs
- DragEventArgs.cs
- DateTimeOffset.cs
- TemplateInstanceAttribute.cs
- CodeConditionStatement.cs
- StylusPointDescription.cs
- RegexCaptureCollection.cs
- Repeater.cs
- XamlFxTrace.cs
- KeyPressEvent.cs
- WebUtil.cs
- FixUp.cs
- PageContentCollection.cs
- SelectionRangeConverter.cs
- MediaPlayerState.cs
- InvalidComObjectException.cs
- WebPartTransformerAttribute.cs
- MultiAsyncResult.cs
- log.cs
- SubordinateTransaction.cs
- WsatConfiguration.cs
- VBIdentifierName.cs
- securitycriticaldataformultiplegetandset.cs
- Rectangle.cs
- XmlIlTypeHelper.cs