Path: redb/redb.Templates/templates/redb-identity-app/RedbIdentityApp.Contracts/Dtos.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.Templates/templates/redb-identity-app/RedbIdentityApp.Contracts/Dtos.cs
----
using System.ComponentModel.DataAnnotations;
namespace RedbIdentityApp.Contracts;
/// Who the module sees behind the bearer token: what Identity answered to the introspection.
public sealed class MeDto
{
public string Subject { get; set; } = "";
public long? UserId { get; set; }
public string? UserName { get; set; }
public string? ClientId { get; set; }
public List Scopes { get; set; } = [];
public List Roles { get; set; } = [];
public DateTimeOffset? ExpiresAt { get; set; }
}
/// A note of the signed-in user. Each user sees only their own notes.
public sealed class NoteDto
{
public long Id { get; set; }
[Required, StringLength(200, MinimumLength = 1)]
public string Title { get; set; } = "";
[StringLength(4000)]
public string? Text { get; set; }
public DateTimeOffset CreatedAt { get; set; }
}
/// One row of the administrator's user list, read from Identity's management API.
public sealed class UserSummaryDto
{
public long Id { get; set; }
public string Login { get; set; } = "";
public string? Name { get; set; }
public string? Email { get; set; }
public bool Enabled { get; set; }
}
/// A page of a list.
public sealed class Page
{
public List Items { get; set; } = [];
public int Total { get; set; }
}
/// An error answer of the module; the message is meant for the user.
public sealed class ApiError
{
public string Message { get; set; } = "";
}