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
- WebPart.cs
- x509utils.cs
- ScalarOps.cs
- MailWebEventProvider.cs
- IdentityModelDictionary.cs
- GPRECTF.cs
- DataServiceHost.cs
- XmlAttribute.cs
- BreakRecordTable.cs
- LabelEditEvent.cs
- SHA384.cs
- CanonicalizationDriver.cs
- VisualTarget.cs
- NetSectionGroup.cs
- IdentityManager.cs
- PrintPreviewControl.cs
- RangeValuePattern.cs
- RepeaterItemCollection.cs
- ToolStripRendererSwitcher.cs
- HttpModule.cs
- Transform3DGroup.cs
- EntityObject.cs
- DataGridViewUtilities.cs
- RemotingConfigParser.cs
- SyndicationLink.cs
- TreeNodeClickEventArgs.cs
- DbConnectionPool.cs
- HyperlinkAutomationPeer.cs
- TransactionTable.cs
- _LoggingObject.cs
- SqlBuilder.cs
- NumberSubstitution.cs
- TypedDatasetGenerator.cs
- ClientTargetSection.cs
- PeerIPHelper.cs
- DbParameterCollectionHelper.cs
- RelationalExpressions.cs
- ToolBarDesigner.cs
- SectionVisual.cs
- ValidationPropertyAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- MgmtConfigurationRecord.cs
- ScriptResourceAttribute.cs
- BaseAsyncResult.cs
- TargetInvocationException.cs
- ControlType.cs
- InfiniteTimeSpanConverter.cs
- TextSpan.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- AssemblyGen.cs
- ExpressionQuoter.cs
- ParameterElement.cs
- BuildManager.cs
- Hex.cs
- DiscoveryReference.cs
- XmlAnyElementAttribute.cs
- ExpressionBuilder.cs
- dataprotectionpermission.cs
- SystemWebCachingSectionGroup.cs
- SystemException.cs
- FieldCollectionEditor.cs
- SecurityChannel.cs
- CqlLexer.cs
- XmlDataSourceView.cs
- ToolStripPanelSelectionGlyph.cs
- DataServiceExpressionVisitor.cs
- XmlSchema.cs
- OptimalTextSource.cs
- CodeEntryPointMethod.cs
- BooleanFacetDescriptionElement.cs
- OracleBinary.cs
- GenerateScriptTypeAttribute.cs
- SafeWaitHandle.cs
- CompressEmulationStream.cs
- BindingBase.cs
- Duration.cs
- DataGridViewElement.cs
- FileAuthorizationModule.cs
- ClientSettingsSection.cs
- CodeNamespaceImport.cs
- URI.cs
- CodeGeneratorAttribute.cs
- MatchAttribute.cs
- DateTimeOffsetAdapter.cs
- AttachmentCollection.cs
- StoragePropertyMapping.cs
- Touch.cs
- PointCollection.cs
- ProfileBuildProvider.cs
- SizeConverter.cs
- DataGridViewRowCollection.cs
- TimeStampChecker.cs
- MenuStrip.cs
- NativeObjectSecurity.cs
- ThumbAutomationPeer.cs
- odbcmetadatacolumnnames.cs
- InternalConfigHost.cs
- Nodes.cs
- ApplicationManager.cs
- ViewCellRelation.cs