namespace PlotLine.Models; public class AuthenticationResult { public bool Success { get; init; } public string? ErrorMessage { get; init; } public bool RequiresTwoFactor { get; init; } public static AuthenticationResult Succeeded() => new() { Success = true }; public static AuthenticationResult Failed(string errorMessage) => new() { ErrorMessage = errorMessage }; } public sealed class RegistrationResult : AuthenticationResult { public int? UserID { get; init; } public static RegistrationResult Succeeded(int userId) => new() { Success = true, UserID = userId }; public new static RegistrationResult Failed(string errorMessage) => new() { ErrorMessage = errorMessage }; }