DocumentOperationsExtensions.GetAsync Method
Applies To: Microsoft Azure
Namespace: Microsoft.Azure.Search
Assembly: Microsoft.Azure.Search (in Microsoft.Azure.Search.dll)
Overload List
| Name | Description | |
|---|---|---|
![]() ![]() |
GetAsync(IDocumentOperations, String) | Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx |
![]() ![]() |
GetAsync(IDocumentOperations, String, IEnumerable<String>) | Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx |
![]() ![]() |
GetAsync<T>(IDocumentOperations, String) | Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx |
![]() ![]() |
GetAsync<T>(IDocumentOperations, String, IEnumerable<String>) | Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx |
See Also
DocumentOperationsExtensions Class
Microsoft.Azure.Search Namespace
Return to top
DocumentOperationsExtensions.GetAsync Method (IDocumentOperations, String)
Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx
Syntax
public static Task<DocumentGetResponse> GetAsync(
this IDocumentOperations operations,
string key
)
public:
[ExtensionAttribute]
static Task<DocumentGetResponse^>^ GetAsync(
IDocumentOperations^ operations,
String^ key
)
static member GetAsync :
operations:IDocumentOperations *
key:string -> Task<DocumentGetResponse>
<ExtensionAttribute>
Public Shared Function GetAsync (
operations As IDocumentOperations,
key As String
) As Task(Of DocumentGetResponse)
Parameters
operations
Type: Microsoft.Azure.Search.IDocumentOperationsReference to the Microsoft.Azure.Search.IDocumentOperations.
key
Type: System.StringThe key of the document to retrieve; See https://msdn.microsoft.com/library/azure/dn857353.aspx for the rules for constructing valid document keys.
Return Value
Type: System.Threading.Tasks.Task<DocumentGetResponse>
Response containing the document.
Remarks
The non-generic overloads of the Get and GetAsync methods make a best-effort attempt to map JSON types in the response payload to .NET types. See GetAsync for more information.
Return to top
DocumentOperationsExtensions.GetAsync Method (IDocumentOperations, String, IEnumerable<String>)
Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx
Syntax
public static Task<DocumentGetResponse> GetAsync(
this IDocumentOperations operations,
string key,
IEnumerable<string> selectedFields
)
public:
[ExtensionAttribute]
static Task<DocumentGetResponse^>^ GetAsync(
IDocumentOperations^ operations,
String^ key,
IEnumerable<String^>^ selectedFields
)
static member GetAsync :
operations:IDocumentOperations *
key:string *
selectedFields:IEnumerable<string> -> Task<DocumentGetResponse>
<ExtensionAttribute>
Public Shared Function GetAsync (
operations As IDocumentOperations,
key As String,
selectedFields As IEnumerable(Of String)
) As Task(Of DocumentGetResponse)
Parameters
operations
Type: Microsoft.Azure.Search.IDocumentOperationsReference to the Microsoft.Azure.Search.IDocumentOperations.
key
Type: System.StringThe key of the document to retrieve; See https://msdn.microsoft.com/library/azure/dn857353.aspx for the rules for constructing valid document keys.
selectedFields
Type: System.Collections.Generic.IEnumerable<String>List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document.
Return Value
Type: System.Threading.Tasks.Task<DocumentGetResponse>
Response containing the document.
Remarks
The non-generic overloads of the Get and GetAsync methods make a best-effort attempt to map JSON types in the response payload to .NET types. See GetAsync for more information.
Return to top
DocumentOperationsExtensions.GetAsync<T> Method (IDocumentOperations, String)
Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx
Syntax
public static Task<DocumentGetResponse<T>> GetAsync<T>(
this IDocumentOperations operations,
string key
)
where T : class
public:
generic<typename T>
where T : ref class
[ExtensionAttribute]
static Task<DocumentGetResponse<T>^>^ GetAsync(
IDocumentOperations^ operations,
String^ key
)
static member GetAsync<'T when 'T : not struct> :
operations:IDocumentOperations *
key:string -> Task<DocumentGetResponse<'T>>
<ExtensionAttribute>
Public Shared Function GetAsync(Of T As Class) (
operations As IDocumentOperations,
key As String
) As Task(Of DocumentGetResponse(Of T))
Parameters
operations
Type: Microsoft.Azure.Search.IDocumentOperationsReference to the Microsoft.Azure.Search.IDocumentOperations.
key
Type: System.StringThe key of the document to retrieve; See https://msdn.microsoft.com/library/azure/dn857353.aspx for the rules for constructing valid document keys.
Return Value
Type: System.Threading.Tasks.Task<DocumentGetResponse<T>>
Response containing the document.
Type Parameters
- T
The CLR type that maps to the index schema. Instances of this type can be retrieved as documents from the index.
Remarks
The generic overloads of the Get and GetAsync methods support mapping of Azure Search field types to .NET types via the type parameter T. See GetAsync<T> for more details on the type mapping.
Return to top
DocumentOperationsExtensions.GetAsync<T> Method (IDocumentOperations, String, IEnumerable<String>)
Retrieves a document from the Azure Search index. https://msdn.microsoft.com/library/azure/dn798929.aspx
Syntax
public static Task<DocumentGetResponse<T>> GetAsync<T>(
this IDocumentOperations operations,
string key,
IEnumerable<string> selectedFields
)
where T : class
public:
generic<typename T>
where T : ref class
[ExtensionAttribute]
static Task<DocumentGetResponse<T>^>^ GetAsync(
IDocumentOperations^ operations,
String^ key,
IEnumerable<String^>^ selectedFields
)
static member GetAsync<'T when 'T : not struct> :
operations:IDocumentOperations *
key:string *
selectedFields:IEnumerable<string> -> Task<DocumentGetResponse<'T>>
<ExtensionAttribute>
Public Shared Function GetAsync(Of T As Class) (
operations As IDocumentOperations,
key As String,
selectedFields As IEnumerable(Of String)
) As Task(Of DocumentGetResponse(Of T))
Parameters
operations
Type: Microsoft.Azure.Search.IDocumentOperationsReference to the Microsoft.Azure.Search.IDocumentOperations.
key
Type: System.StringThe key of the document to retrieve; See https://msdn.microsoft.com/library/azure/dn857353.aspx for the rules for constructing valid document keys.
selectedFields
Type: System.Collections.Generic.IEnumerable<String>List of field names to retrieve for the document; Any field not retrieved will have null or default as its corresponding property value in the returned object.
Return Value
Type: System.Threading.Tasks.Task<DocumentGetResponse<T>>
Response containing the document.
Type Parameters
- T
The CLR type that maps to the index schema. Instances of this type can be retrieved as documents from the index.
Remarks
The generic overloads of the Get and GetAsync methods support mapping of Azure Search field types to .NET types via the type parameter T. See GetAsync<T> for more details on the type mapping.
Return to top
.jpeg)
.gif)