Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / QueryResponse.cs / 1 / 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
- RelationshipDetailsCollection.cs
- IgnoreSection.cs
- BindingContext.cs
- FormClosedEvent.cs
- DocumentSequenceHighlightLayer.cs
- XsltInput.cs
- dsa.cs
- StringFormat.cs
- RequiredArgumentAttribute.cs
- FindRequestContext.cs
- LostFocusEventManager.cs
- Pair.cs
- BCLDebug.cs
- XmlQualifiedName.cs
- IDictionary.cs
- DataGridRowEventArgs.cs
- ViewCellSlot.cs
- ListItemParagraph.cs
- ParameterCollection.cs
- DoubleAnimation.cs
- MultiBindingExpression.cs
- GACIdentityPermission.cs
- DispatcherExceptionEventArgs.cs
- KeyBinding.cs
- OdbcConnection.cs
- SystemParameters.cs
- CachedCompositeFamily.cs
- EventManager.cs
- TransformConverter.cs
- SHA512.cs
- ProtocolsConfigurationHandler.cs
- PrintPreviewGraphics.cs
- XmlSubtreeReader.cs
- ToolboxComponentsCreatingEventArgs.cs
- DataRowChangeEvent.cs
- XsltQilFactory.cs
- UdpDiscoveryMessageFilter.cs
- BooleanFacetDescriptionElement.cs
- Nodes.cs
- MemberListBinding.cs
- RepeaterItemEventArgs.cs
- InvokeProviderWrapper.cs
- DataGridViewComboBoxColumn.cs
- CodeSnippetTypeMember.cs
- SchemaExporter.cs
- QuotedPrintableStream.cs
- MutexSecurity.cs
- DodSequenceMerge.cs
- InputLanguageCollection.cs
- OleDbWrapper.cs
- ImageClickEventArgs.cs
- DataContractSerializerFaultFormatter.cs
- Vector3DCollectionConverter.cs
- FakeModelPropertyImpl.cs
- PreservationFileReader.cs
- SchemaCollectionCompiler.cs
- TimeSpanParse.cs
- Trigger.cs
- Transform.cs
- MetadataUtil.cs
- WindowsFont.cs
- CacheChildrenQuery.cs
- PageContentAsyncResult.cs
- UpdateTracker.cs
- CodeArrayCreateExpression.cs
- WebColorConverter.cs
- DataAccessException.cs
- ImageBrush.cs
- SendActivityValidator.cs
- SapiInterop.cs
- ToolStripGripRenderEventArgs.cs
- AddInActivator.cs
- Effect.cs
- GridProviderWrapper.cs
- PageParserFilter.cs
- Double.cs
- ContactManager.cs
- RecognizedWordUnit.cs
- GroupBox.cs
- CompilerState.cs
- ChildTable.cs
- DefinitionUpdate.cs
- OracleSqlParser.cs
- DirectoryInfo.cs
- HtmlFormParameterWriter.cs
- ModuleElement.cs
- xsdvalidator.cs
- __Filters.cs
- GPRECTF.cs
- RepeatButton.cs
- XamlInt32CollectionSerializer.cs
- SqlIdentifier.cs
- FontNamesConverter.cs
- PreviewPageInfo.cs
- QueryStringParameter.cs
- IdnMapping.cs
- FormatterServices.cs
- ManagedIStream.cs
- CompositeClientFormatter.cs
- BinarySerializer.cs