Path: redb/redb.Core/Models/Entities/RedbRole.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Models/Entities/RedbRole.cs
----
using redb.Core.Models.Contracts;
using System;
using System.Text.Json.Serialization;
namespace redb.Core.Models.Entities
{
///
/// REDB role entity with direct data storage.
/// Maps to _roles table in PostgreSQL.
///
public class RedbRole : IRedbRole
{
///
/// Unique role identifier.
///
[JsonPropertyName("id")]
public long Id { get; set; }
///
/// Role name.
///
[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
///
/// Configuration object ID (optional).
///
[JsonPropertyName("id_configuration")]
public long? IdConfiguration { get; set; }
///
/// Default constructor for deserialization and mapping.
///
public RedbRole()
{
}
///
/// Constructor with name.
///
public RedbRole(string name)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
}
public override string ToString()
{
return $"Role {Id}: {Name}";
}
}
}