| | | 1 | | using Elsa.Identity.Contracts; |
| | | 2 | | using Elsa.Identity.Entities; |
| | | 3 | | using Elsa.Identity.Models; |
| | | 4 | | |
| | | 5 | | // ReSharper disable once CheckNamespace |
| | | 6 | | namespace Elsa.Extensions; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Provides extensions for <see cref="IApplicationProvider"/>. |
| | | 10 | | /// </summary> |
| | | 11 | | public static class ApplicationProviderExtensions |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Finds the application with the specified client ID. |
| | | 15 | | /// </summary> |
| | | 16 | | /// <param name="applicationProvider">The user provider.</param> |
| | | 17 | | /// <param name="clientId">The client ID to search by.</param> |
| | | 18 | | /// <param name="cancellationToken">The cancellation token.</param> |
| | | 19 | | /// <returns>The application with the specified client ID.</returns> |
| | | 20 | | public static async Task<Application?> FindByClientIdAsync(this IApplicationProvider applicationProvider, string cli |
| | | 21 | | { |
| | 0 | 22 | | var filter = new ApplicationFilter |
| | 0 | 23 | | { |
| | 0 | 24 | | ClientId = clientId |
| | 0 | 25 | | }; |
| | | 26 | | |
| | 0 | 27 | | return await applicationProvider.FindAsync(filter, cancellationToken); |
| | 0 | 28 | | } |
| | | 29 | | } |