/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFramework.Models;
///
/// Represents an OpenIddict scope.
///
public class OpenIddictEntityFrameworkScope : OpenIddictEntityFrameworkScope
{
public OpenIddictEntityFrameworkScope()
{
// Generate a new string identifier.
Id = Guid.NewGuid().ToString();
}
}
///
/// Represents an OpenIddict scope.
///
[DebuggerDisplay("Id = {Id.ToString(),nq} ; Name = {Name,nq}")]
public class OpenIddictEntityFrameworkScope where TKey : notnull, IEquatable
{
///
/// Gets or sets the concurrency token.
///
public virtual string? ConcurrencyToken { get; set; } = Guid.NewGuid().ToString();
///
/// Gets or sets the public description associated with the current scope.
///
public virtual string? Description { get; set; }
///
/// Gets or sets the localized public descriptions associated
/// with the current scope, serialized as a JSON object.
///
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Descriptions { get; set; }
///
/// Gets or sets the display name associated with the current scope.
///
public virtual string? DisplayName { get; set; }
///
/// Gets or sets the localized display names
/// associated with the current application,
/// serialized as a JSON object.
///
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? DisplayNames { get; set; }
///
/// Gets or sets the unique identifier associated with the current scope.
///
public virtual TKey? Id { get; set; }
///
/// Gets or sets the unique name associated with the current scope.
///
public virtual string? Name { get; set; }
///
/// Gets or sets the additional properties serialized as a JSON object,
/// or if no bag was associated with the current scope.
///
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
///
/// Gets or sets the resources associated with the
/// current scope, serialized as a JSON array.
///
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Resources { get; set; }
}