// 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; using System.Security.Claims; namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore { /// /// Represents a claim that is granted to all users within a role. /// /// The type of the primary key of the role associated with this claim. public class IdentityRoleClaim where TKey : IEquatable { /// /// Gets or sets the identifier for this role claim. /// public virtual int Id { get; set; } /// /// Gets or sets the of the primary key of the role associated with this claim. /// public virtual TKey RoleId { get; set; } /// /// Gets or sets the claim type for this claim. /// public virtual string ClaimType { get; set; } /// /// Gets or sets the claim value for this claim. /// public virtual string ClaimValue { get; set; } public virtual Claim ToClaim() { return new Claim(ClaimType, ClaimValue); } public virtual void InitializeFromClaim(Claim other) { ClaimType = other?.Type; ClaimValue = other?.Value; } } }