Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / QueryResponse.cs / 4 / QueryResponse.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Response to a batched query. // //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections; using System.Collections.Generic; using System.Reflection; ////// Response to a batched query. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010", Justification = "required for this feature")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710", Justification = "required for this feature")] public class QueryOperationResponse : OperationResponse, System.Collections.IEnumerable { ///Original query private DataServiceRequest query; ///Enumerable of objects in query private System.Collections.IEnumerable results; ////// constructor /// /// HTTP headers /// original query /// retrieved objects internal QueryOperationResponse(Dictionaryheaders, DataServiceRequest query, System.Collections.IEnumerable results) : base(headers) { this.query = query; this.results = results; } /// The query that executed within the batch. public DataServiceRequest Query { get { return this.query; } } ///get a non-null enumerable of the result internal System.Collections.IEnumerable Results { get { if (null != this.Error) { throw System.Data.Services.Client.Error.InvalidOperation(Strings.Context_BatchExecuteError, this.Error); } return this.results ?? Array.CreateInstance(this.query.ElementType, 0); } } ///Results from a query ///enumerator of objects in query public System.Collections.IEnumerator GetEnumerator() { return this.Results.GetEnumerator(); } ////// Creates a generic instance of the QueryOperationResponse and return it /// /// generic type for the QueryOperationResponse. /// constructor parameter1 /// constructor parameter2 /// constructor parameter3 ///returns a new strongly typed instance of QueryOperationResponse. internal static QueryOperationResponse GetInstance(Type elementType, Dictionaryheaders, DataServiceRequest query, IEnumerable results) { Type genericType = typeof(QueryOperationResponse<>).MakeGenericType(elementType); return (QueryOperationResponse)Activator.CreateInstance( genericType, BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { headers, query, results }, System.Globalization.CultureInfo.InvariantCulture); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // //// Response to a batched query. // //--------------------------------------------------------------------- namespace System.Data.Services.Client { using System; using System.Collections; using System.Collections.Generic; using System.Reflection; ////// Response to a batched query. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010", Justification = "required for this feature")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710", Justification = "required for this feature")] public class QueryOperationResponse : OperationResponse, System.Collections.IEnumerable { ///Original query private DataServiceRequest query; ///Enumerable of objects in query private System.Collections.IEnumerable results; ////// constructor /// /// HTTP headers /// original query /// retrieved objects internal QueryOperationResponse(Dictionaryheaders, DataServiceRequest query, System.Collections.IEnumerable results) : base(headers) { this.query = query; this.results = results; } /// The query that executed within the batch. public DataServiceRequest Query { get { return this.query; } } ///get a non-null enumerable of the result internal System.Collections.IEnumerable Results { get { if (null != this.Error) { throw System.Data.Services.Client.Error.InvalidOperation(Strings.Context_BatchExecuteError, this.Error); } return this.results ?? Array.CreateInstance(this.query.ElementType, 0); } } ///Results from a query ///enumerator of objects in query public System.Collections.IEnumerator GetEnumerator() { return this.Results.GetEnumerator(); } ////// Creates a generic instance of the QueryOperationResponse and return it /// /// generic type for the QueryOperationResponse. /// constructor parameter1 /// constructor parameter2 /// constructor parameter3 ///returns a new strongly typed instance of QueryOperationResponse. internal static QueryOperationResponse GetInstance(Type elementType, Dictionaryheaders, DataServiceRequest query, IEnumerable results) { Type genericType = typeof(QueryOperationResponse<>).MakeGenericType(elementType); return (QueryOperationResponse)Activator.CreateInstance( genericType, BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { headers, query, results }, System.Globalization.CultureInfo.InvariantCulture); } } } // 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
- HotCommands.cs
- TextClipboardData.cs
- AstTree.cs
- HtmlInputImage.cs
- XmlComplianceUtil.cs
- ModelItemDictionaryImpl.cs
- LayoutDump.cs
- RenderContext.cs
- Point3DCollectionConverter.cs
- StylusPlugin.cs
- TableRowGroup.cs
- CommandManager.cs
- Memoizer.cs
- SmiConnection.cs
- Visual.cs
- SimpleBitVector32.cs
- ResourceExpressionBuilder.cs
- ActivityXRefPropertyEditor.cs
- TreeViewImageKeyConverter.cs
- SecurityTokenException.cs
- XmlSchemaIdentityConstraint.cs
- CodeIdentifier.cs
- ExplicitDiscriminatorMap.cs
- LicenseException.cs
- FormViewInsertedEventArgs.cs
- RotationValidation.cs
- Function.cs
- ISAPIRuntime.cs
- Int32CollectionValueSerializer.cs
- RemoteCryptoSignHashRequest.cs
- EnvelopedPkcs7.cs
- EdmToObjectNamespaceMap.cs
- brushes.cs
- SqlUDTStorage.cs
- KeyEventArgs.cs
- MdImport.cs
- File.cs
- TraceUtils.cs
- QilDataSource.cs
- TableAdapterManagerMethodGenerator.cs
- IndentTextWriter.cs
- PostBackOptions.cs
- DataGridViewDataConnection.cs
- WebBrowserPermission.cs
- SqlProfileProvider.cs
- SqlGenerator.cs
- _UriSyntax.cs
- SizeLimitedCache.cs
- TextViewElement.cs
- PropertyAccessVisitor.cs
- SessionEndingEventArgs.cs
- RuntimeConfigurationRecord.cs
- WebPartUtil.cs
- BitmapImage.cs
- UIInitializationException.cs
- SettingsPropertyValue.cs
- ServiceInstallComponent.cs
- BamlStream.cs
- FormViewInsertEventArgs.cs
- figurelength.cs
- BindingContext.cs
- Drawing.cs
- ContextMenu.cs
- VectorAnimationUsingKeyFrames.cs
- PropertyGrid.cs
- Rights.cs
- StrongNameKeyPair.cs
- LifetimeMonitor.cs
- CompositeActivityCodeGenerator.cs
- SQLByte.cs
- FrameworkEventSource.cs
- TextContainerChangeEventArgs.cs
- ContentIterators.cs
- IntPtr.cs
- DataGridParentRows.cs
- XmlSchemaSimpleContentExtension.cs
- CollectionEditor.cs
- IisTraceWebEventProvider.cs
- ChangePassword.cs
- BuildProviderAppliesToAttribute.cs
- UrlMapping.cs
- TrackingProfileDeserializationException.cs
- MasterPageParser.cs
- ApplicationServiceManager.cs
- ListBindingConverter.cs
- ControlBuilderAttribute.cs
- AssertFilter.cs
- Application.cs
- CounterSet.cs
- ConnectorDragDropGlyph.cs
- TableLayoutSettings.cs
- NativeActivityTransactionContext.cs
- Inflater.cs
- WinEventWrap.cs
- WebRequestModulesSection.cs
- Expression.DebuggerProxy.cs
- EntityDataSourceState.cs
- SpinLock.cs
- _SafeNetHandles.cs
- UriSection.cs