using Elsa.Identity.Contracts; using Elsa.Identity.Entities; using Elsa.Identity.Models; // ReSharper disable once CheckNamespace namespace Elsa.Extensions; /// /// Provides extensions for . /// public static class RoleProviderExtensions { /// /// Finds the roles with the specified IDs. /// /// The role provider. /// The IDs to filter for. /// The cancellation token. /// The roles with the specified IDs. public static async Task> FindByIdsAsync(this IRoleProvider roleProvider, IEnumerable ids, CancellationToken cancellationToken = default) { var filter = new RoleFilter() { Ids = ids.Distinct().ToList() }; return await roleProvider.FindManyAsync(filter, cancellationToken); } }