// 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; namespace Microsoft.AspNetCore.Identity { /// /// The default implementation of which uses a string as the primary key. /// public class IdentityRole : IdentityRole { /// /// Initializes a new instance of . /// /// /// The Id property is initialized to form a new GUID string value. /// public IdentityRole() { Id = Guid.NewGuid().ToString(); } /// /// Initializes a new instance of . /// /// The role name. /// /// The Id property is initialized to form a new GUID string value. /// public IdentityRole(string roleName) : this() { Name = roleName; } } /// /// Represents a role in the identity system /// /// The type used for the primary key for the role. public class IdentityRole where TKey : IEquatable { /// /// Initializes a new instance of . /// public IdentityRole() { } /// /// Initializes a new instance of . /// /// The role name. public IdentityRole(string roleName) : this() { Name = roleName; } /// /// Gets or sets the primary key for this role. /// public virtual TKey Id { get; set; } /// /// Gets or sets the name for this role. /// public virtual string Name { get; set; } /// /// Gets or sets the normalized name for this role. /// public virtual string NormalizedName { get; set; } /// /// A random value that should change whenever a role is persisted to the store /// public virtual string ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString(); /// /// Returns the name of the role. /// /// The name of the role. public override string ToString() { return Name; } } }