aspnetcore/src/Core/IRoleValidator.cs

22 lines
981 B
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Identity
{
/// <summary>
/// Provides an abstraction for a validating a role.
/// </summary>
/// <typeparam name="TRole">The type encapsulating a role.</typeparam>
public interface IRoleValidator<TRole> where TRole : class
{
/// <summary>
/// Validates a role as an asynchronous operation.
/// </summary>
/// <param name="manager">The <see cref="RoleManager{TRole}"/> managing the role store.</param>
/// <param name="role">The role to validate.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="IdentityResult"/> of the asynchronous validation.</returns>
Task<IdentityResult> ValidateAsync(RoleManager<TRole> manager, TRole role);
}
}