Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ExpressionVisitorHelpers.cs / 1305376 / 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
- XmlQualifiedName.cs
- XamlStyleSerializer.cs
- CommandManager.cs
- PocoPropertyAccessorStrategy.cs
- CustomValidator.cs
- ImageIndexEditor.cs
- DesignerHierarchicalDataSourceView.cs
- PathSegment.cs
- CqlWriter.cs
- BaseDataList.cs
- ColorConvertedBitmapExtension.cs
- _FtpDataStream.cs
- TemplatePartAttribute.cs
- SchemaElementLookUpTable.cs
- WebPageTraceListener.cs
- CustomAttributeFormatException.cs
- ChangePasswordAutoFormat.cs
- CancellationState.cs
- OneOfConst.cs
- RangeBase.cs
- BamlReader.cs
- DataServiceHost.cs
- UnSafeCharBuffer.cs
- AspNetSynchronizationContext.cs
- StateChangeEvent.cs
- cookiecollection.cs
- ListSortDescription.cs
- NavigationPropertySingletonExpression.cs
- RankException.cs
- ConnectionProviderAttribute.cs
- ContainerParaClient.cs
- MessagePropertyVariants.cs
- SafeProcessHandle.cs
- X509Certificate.cs
- SecurityContextTokenCache.cs
- CharUnicodeInfo.cs
- HttpDictionary.cs
- CellPartitioner.cs
- ExternalFile.cs
- ParameterBuilder.cs
- DBSqlParserColumn.cs
- DataErrorValidationRule.cs
- XmlTextWriter.cs
- FormClosingEvent.cs
- StateBag.cs
- CompositeControl.cs
- TransactionContextValidator.cs
- SecurityPermission.cs
- BaseTemplateCodeDomTreeGenerator.cs
- StaticContext.cs
- SafeUserTokenHandle.cs
- BitArray.cs
- BasePropertyDescriptor.cs
- WinEventTracker.cs
- BuildProvider.cs
- WindowExtensionMethods.cs
- BitmapEffect.cs
- SendMessageContent.cs
- CommandPlan.cs
- DetailsViewPageEventArgs.cs
- CustomCredentialPolicy.cs
- ContentFileHelper.cs
- ExtensionWindowResizeGrip.cs
- EdmError.cs
- XmlNamespaceDeclarationsAttribute.cs
- TextEditorThreadLocalStore.cs
- PersistenceTypeAttribute.cs
- TemplatePartAttribute.cs
- basevalidator.cs
- Configuration.cs
- UntypedNullExpression.cs
- Renderer.cs
- Control.cs
- EventEntry.cs
- OracleMonthSpan.cs
- ConfigurationProperty.cs
- EntityContainer.cs
- ComponentConverter.cs
- ObjectListDesigner.cs
- CompiledXpathExpr.cs
- SpotLight.cs
- SystemDiagnosticsSection.cs
- EditorBrowsableAttribute.cs
- WebPartZoneAutoFormat.cs
- HttpProtocolReflector.cs
- RadioButtonFlatAdapter.cs
- PreviewPrintController.cs
- IntegerValidator.cs
- LookupNode.cs
- XmlComplianceUtil.cs
- ConfigurationProperty.cs
- TypeDelegator.cs
- login.cs
- NativeObjectSecurity.cs
- ZipFileInfoCollection.cs
- CryptoStream.cs
- RepeaterItem.cs
- PageCopyCount.cs
- HtmlInputRadioButton.cs
- SQLBytes.cs