-
-
Save ThomasPe/716dd71c20c408625b01d64263d4160d to your computer and use it in GitHub Desktop.
Get first row from Azure Table Storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Returns first entity in the table | |
/// </summary> | |
/// <typeparam name="T">Implementation of ITableEntity</typeparam> | |
/// <param name="tableClient">The authenticated TableClient</param> | |
/// <returns>First entity in table</returns> | |
public static async Task<T> GetFirstEntityAsync<T>(this TableClient tableClient) where T : class, ITableEntity, new() | |
{ | |
return await tableClient.QueryAsync<T>(maxPerPage: 1).FirstOrDefaultAsync(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment